Singleton
In plain terms
A design pattern ensuring a class has only one shared instance.
Going deeper
The Singleton restricts a class to a single object with a global access point, used for things like config or connection pools. Overuse can create hidden global state and testing headaches.
Under the hood
Often an anti-pattern due to hidden global state and testability issues; dependency injection of a single instance is usually cleaner. Needs thread-safe initialization.
Examples
Config managers, logging instances, connection pools, database access objects.
Think of it like...
Like a country having exactly one president: anyone who needs 'the president' gets the same single official, not a new one each time.