Singleton Pattern
A pattern that allows only one object of a class for the whole program.
What is Singleton Pattern?
The Singleton pattern makes sure a class has only one object for the whole program, like one shared settings object. Use it sparingly: it can make testing harder.
public sealed class AppSettings
{
public static AppSettings Instance { get; } = new();
private AppSettings() { }
}
Level: Freelancer · More OOP terms at this level
Updated