Singleton Pattern

Note

The Singleton Pattern is a Design Pattern where we instantiate a global instance that gets then shared throughout our app. This instance is instantiated once and then shared throughout our app.

Simplest Example is a class Counter() that has different method and a instance variable that is set to this in the constructor. That way it can really only be created once.


Questions

Why are Singletons an Anti-Pattern?

Terms

Design Patterns

References