Understanding the Singleton pattern
The Singleton pattern is a creational design pattern that guarantees only one instance will exist for a class embracing this idiom; two or more instances of the type may simply not exist simultaneously. A class embracing this pattern will be known as a Singleton.
A Singleton can be implemented using static data members and static methods. This means that a Singleton will have a global point of access to the instance at hand. This ramification initially seems dangerous; introducing global state information into the code is one criticism that has led the Singleton to sometimes be considered an anti-pattern. However, with the appropriate use of access regions for the static data members defining the Singleton, we can insist that access to the Singleton (other than initialization) only uses the appropriate static methods of the class at hand (and alleviate this potential pattern concern).
Another criticism of the pattern is that it is not thread...