Так что я смотрю на какой-то пример кода, и я не уверен, что сделать это:Activator.CreateInstance - Объясните это, так что я могу понять
Private Shared _instance As PollsProvider = Nothing
Public Shared ReadOnly Property Instance() As PollsProvider
Get
If IsNothing(_instance) Then
_instance = CType(Activator.CreateInstance(_
Type.GetType(Globals.Settings.Polls.ProviderType)), PollsProvider)
End If
Return _instance
End Get
End Property
В чем разница между выше и как я обычно делают синглтона:
Private Shared _instance As PollsProvider = Nothing
Public Shared ReadOnly Property Instance() As PollsProvider
Get
If IsNothing(_instance) Then
_instance = New PollsProvider
End If
Return _instance
End Get
End Property