November 2014
Beginner
336 pages
10h 58m
English
The Singleton pattern is a type of class that can have only one instance. Every time you try create to create an instance of a Singleton, you don’t actually get a new instance—you are really getting only a reference to a single instance. For example, the PacMan class could be implemented as a Singleton. You might try to create an instance of PacMan in several different places in your code, but you really want only one PacMan. If the PacMan object has already been created, you don’t actually want to create a second PacMan; you really just want a reference to the existing PacMan.
Read now
Unlock full access