The singleton design pattern force to have only one instance of a class.
The implementation require a mechanism to access the same instance of the class without recreate it every time. It can be achieved creating a class with a method that creates a new instance of the class if one does not exist. If an instance already exists, it simply returns a reference to that object. To make sure that the object cannot be instantiated any other way, the constructor is made protected. More...