Singleton Pattern Creational Design Pattern - aa1994/DesignPatterns GitHub Wiki

Singleton Pattern is part of the Creational Design Pattern category.

This design pattern prevents more than one instantiation of a class.

The pattern can be used in cases when we require one instance of a class such as a database or a third party library like Retrofit to make network calls. The one instance created will be used throughout the codebase. Thus the class should be accessible from throughout the codebase.