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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.