Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 737 Bytes

File metadata and controls

11 lines (8 loc) · 737 Bytes

Intro-To-Singleton-Design-Pattern

Singleton is a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.

  1. The Singleton class declares the static method getInstance that returns the same instance of its own class. The Singleton’s constructor should be hidden from the client code. Calling the getInstance method should be the only way of getting the Singleton object.

Image and Description source: Dive Into DESIGN PATTERNS by Alexander Shvets
Link to the book : https://refactoring.guru/design-patterns/book