The Singleton is a design pattern that can be used when you want to guarantee that there is only one instance of a particular class. Technically it is quite a simple pattern, involving only one class. Usually it is implemented like this: