Singleton Design Pattern: One Instance to Rule Them All

Iqram Ali
5 min readFeb 11, 2024

Singleton pattern violates the Single Responsibility Principle, responsible for both managing its instance and providing a service — Dual responsibility make the code less modular and harder to maintain.

What is Singelton pattern?

The Singleton pattern is a design pattern that falls under the creational category. It is used to ensure that a class has only one instance and provides a global point of access to that instance. In other words, it restricts the instantiation of a class to a single object and…

--

--

Iqram Ali

Developer influencer, 15+ years in software development currently in engineering leadership role.