Object-Oriented Programming

Singleton Pattern

English

Overview

A design pattern that guarantees a class has at most one instance.

Details

A design pattern that controls a class's instantiation, guaranteeing a single instance across the entire application. Because it easily introduces global mutable state and makes testing harder, managing the lifecycle through a DI (dependency injection) container has become the preferred approach in recent years.

More Programming terms