Creational patterns
Creational design patterns are those software design patterns that deal with the mechanism of object creation in a flexible, maintainable manner under certain situations or scenarios.
Let's jump on to the individual creational pattern to see its detail.
The singleton pattern
The singleton pattern is perhaps the most common pattern used by developers across the globe. This pattern basically defines a class for which only one (single) instance can exist.
You can have a class that is either global or static with all static methods so that you do not need to create any instance of this class and use it directly. This is okay but not considered a best practice generally, unless you are defining a stateless interface to expose an underlying OS APIs, such as subset win32
APIs or a native DLL or system library exposing its one-off APIs.
Singleton - If you want to have a stateful class whose only one instance should exist in the given software, then what you need is a singleton class...