Get an instance used for wrapped constructor type classes.

Namespace: MonoSoftware.Core
Assembly: MonoSoftware.Core (in MonoSoftware.Core.dll) Version: 1.0.40.669 (1.0.40.669)

Syntax

C#
public static T GetInstance<T>()
where T : class
Visual Basic
Public Shared Function GetInstance(Of T As Class) As T
Visual C++
public:
generic<typename T>
where T : ref class
static T GetInstance()
F#
static member GetInstance : unit -> 'T  when 'T : not struct

Type Parameters

T
Object type

Return Value

Type: T
Object instance

Remarks

Returns an instance of the object, wraps the constructor to allow for encapsulated instatiation, so the logic in he constructor can be changed without changing the client code. Reference: http://www.netobjectives.com/ezines/ez0405NetObj_PerspectivesOfUseVsCreationInOODesign.pdf

See Also