So I am looking at some sample code, and I am not sure what to make of this:
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
What is the difference between the above and how I would normally make a singleton:
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