What classes in the .NET Platform use the Singleton pattern?
Just want to take a look at them through Reflector and see how are implemented, and more than it, how Singleton can be used in different contexts.
What classes in the .NET Platform use the Singleton pattern?
Just want to take a look at them through Reflector and see how are implemented, and more than it, how Singleton can be used in different contexts.
Pretty much where you see Provider
in the name. Especially in the FormsAuthenication and Membership parts of ASP.NET.
public sealed class DBNull
{
public static readonly DBNull Value;
static DBNull()
{
Value = new DBNull();
}
private DBNull() {}
}
Definitely the Settings
classes which derive from System.Configuration.ApplicationSettingsBase
. Pretty much all the application/user scope settings are managed by singleton instances.