GOFPatterns 
eWebProgrammer J2EEOnline
prev next
Course navigation
Singleton Pattern: intent and motivation
Multiple motivations for Singleton Design Pattern
This is not the only motivation for the Singleton pattern.
The Gang of Four suggests several other motivations including:
  1. File and window managers
  2. A/D converters in digital filters
  3. The company an accounting system serves
Later in this module, you will use the Singleton pattern to guarantee that the traffic light manager has only one instance. This allows that instance to insure that the lights stay in sync.
Most patterns have many different motivations.
There would not be much point to a design pattern that was only useful in one context. Design patterns are supposed to be adaptable to a broad range of problems.
Course navigation