Singleton Pattern
The Singleton pattern is a creational design pattern that restricts a class to a single instance and provides a global point of access to that instance.
10 resources across 4 libraries
Glossary Terms(3)
Singleton Pattern
The Singleton pattern is a creational design pattern that restricts a class to a single instance and provides a global point of access to that instance.
Factory Pattern
The Factory pattern is a creational design pattern that delegates object creation to a dedicated method or class, so calling code can obtain new instances with…
Builder Pattern
The Builder pattern is a creational design pattern that separates the construction of a complex object from its representation, using a step-by-step builder ob…
Study Notes(1)
Cheat Sheets(1)
Interview Questions(5)
Singleton vs Static Class
A Singleton is a regular class restricted to exactly one instance that is still a real object — it can implement interfaces, be passed around, be subclassed, a…
Thread Safety in the Singleton Pattern
Thread safety in the Singleton pattern means guaranteeing that when multiple threads call the accessor concurrently before the instance exists, only one instan…
What is a Thread-Safe Singleton?
A thread-safe Singleton is an implementation of the Singleton pattern that guarantees exactly one instance is created and visible to every thread even when mul…
What is Lazy Initialization in OOP?
Lazy initialization is the technique of deferring the creation of an expensive object or the computation of a value until the exact moment it is first actually…
What is a Private Constructor?
A private constructor is a constructor declared with the private access modifier so it can only be invoked from within its own class, preventing external code…