Taking advantage of the .NET framework, a singleton can be implemented as
follows:
// .NET Singleton
sealed class Singleton
{
private Singleton() {}
public static readonly Singleton Instance = new Singleton();
}
Read the article at http://msdn.microsoft.com/en-us/library/ms954629.aspx
Saturday, June 21, 2008
The Singleton and the .NET framework
Labels:
design patterns,
singleton
Subscribe to:
Posts (Atom)