|Lesson 5|| Singleton Design Pattern Structure |
|Objective||Study the structure of the Singleton. |
Singleton Design Pattern Structure
Here is a diagram showing the structure of the Singleton pattern.
Singleton Design Structure
The pattern of the Singleton is a relatively simple pattern, therefore its diagram is relatively simple.
None of the names here are important. In general, the names of the methods, fields, and classes change in each different implementation.
What is important is the relationships between the different parts, and the roles each part plays in the whole pattern.
You should also note that the entire class is not diagrammed here, only the parts relevant to the pattern.
For instance, it is almost certain that the class has some other methods and fields. If it's an
AudioDevice class discussed in the motivation,
it probably has some sort of
play() methods for example.
However, these are not part of the pattern itself.
Singleton Pattern - Quiz