Intent
One instance of a class or one value accessible globally in an application.
Where to use & benefits
- Ensure unique instance by defining class final to prevent cloning.
- May be extensible by the subclass by defining subclass final.
- Make a method or a variable public or/and static.
- Access to the instance by the way you provided.
- Well control the instantiation of a class.
- Define one value shared by all instances by making it static.
Structure

Participants
Singleton (ShapeContainerFullState, ShapeContainerEmptyState, ShapeContainerFullState)
defines an Instance operation that lets clients access its unique instance. Instance is a class operation and responsible for creating and maintaining its own unique instance
Example
In the demonstration application, that shape container states (ShapeContainerFullState, ShapeContainerEmptyState and ShapeContainerPartialState) are modeled as singleton object. Here the singleton feature is achieved by making the constructor as private and providing the static method to create/return the object.
Class Diagram
