Design Pattern : Singleton Design Pattern
The Singleton Pattern is a creational design pattern that ensures a class has only one instance and provides a single point of access to it globally. It is commonly used in scenarios involving shared resources like database connections, configuration settings, etc.
- Controlled access to a single instance
- Reduces memory footprint
- Useful for shared resources like config managers, logging, thread pools, etc.
- Logging classes
- Configuration managers
- Caching
- Database connection pools