What is a singleton pattern?

What is a singleton pattern?

Approach: Describe restriction of class instantiation.

Design pattern that ensures a class has only one instance and provides a global point of access to it.

Follow-up: Why is it often considered an anti-pattern?

Key concepts: private constructor, static instance, global access point.