Chapter 4. Singleton Pattern

<feature><title>In This Chapter</title> </feature>

The Singleton design pattern is used to limit a class to one instance and provide global access to that instance. In many cases, you need to limit a class to only one instance. Common examples include classes that manage resources that are intrinsically singular such as selection focus, navigation history, and window depth. Consider the case of a class that manages the state of the user’s cursor. Because there is only ever one cursor, you shouldn’t have more than one instance of that class. Another example is a class that loads application ...

Get Advanced ActionScript 3 with Design Patterns now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.