Singleton Design Pattern Videos

Singleton Design Pattern is a part of Creational Pattern
Intent

  • We have to ensure the class has only one instance, and provide a global point of access to it.
  • Encapsulated “just-in-time initialization” or “initialization on first use”.
Singleton Design Pattern Videos
To be considered for Singleton Design Pattern
  • Define a private static attribute in the “single instance” class.
  • Define a public static accessor function in the class.
  • Do “lazy initialization” (creation on first use) in the accessor function.
  • Define all constructors to be protected or private.
  • Clients may only use the accessor function to manipulate the Singleton.  

Why to read, you can watch the below videos to understand Singleton Design pattern and its implementations ?

Related posts:

  1. Factory Method Design Pattern Videos

Comments are closed.