If a snake swallows someone in a dream, it means that he will reach a powerful position. If one sees a snake sitting over his head in a dream, it means that he will earn the respect of people in authority. A field which is covered with snakes in a dream represents a destructive rain.
Make the class of the single instance responsible for access and initialization on first use. The single instance is a private static attribute. The accessor function is a public static method. The Singleton pattern ensures that a class has only one instance and provides a global point of access to that instance. It is named after the singleton set, which is defined to be a set containing one element. The office of the President of the United States is a Singleton.
Singleton Design Pattern in C#. Design Patterns provide solutions to common recurring problems. Design patterns can be classified as creational, structural or behavioral .Singleton and Factory patterns are two of the creational pattern.Here we will discuss these two patterns. Design Patterns provide solutions to common recurring problems. Design patterns can be classified as creational, structural or behavioral .Singleton and Factory patterns are two of the creational pattern.Here we will discuss these two patterns .In the later posts we will discuss other design patterns.