ActionScript 3.0 Design Patterns
100 | Chapter 2: Factory Method Pattern Concrete Creator Classes Until we encountered theShipCreatorclass (Example 2-39), the ex ...
101 Chapter 3 CHAPTER 3 Singleton Pattern 3 The aspects of things that are most important to us are hidden because of their simp ...
102 | Chapter 3: Singleton Pattern in teamwork, the Singleton can be used to make sure another developer on the team doesn’t cre ...
Key OOP Concepts Used with the Singleton Pattern | 103 That looks pretty simple. However, looking at it carefully, you’ll find a ...
104 | Chapter 3: Singleton Pattern To create a class, we need a public constructor function within a package. Because we cannot ...
Minimalist Abstract Singleton | 105 Why aren’t there any private classes in ActionScript 3.0? Private classes haven’t yet been i ...
106 | Chapter 3: Singleton Pattern Save the files asSingleton.as. You now have a Singleton to work with. The next step is actual ...
Minimalist Abstract Singleton | 107 Save the file asBadImplementation.asin the same folder as theSingleton.as.Ina Flash document ...
108 | Chapter 3: Singleton Pattern So what does this mean? Essentially, the compiler does not recognize the class namedPrivateCl ...
Minimalist Abstract Singleton | 109 Now, we can write a class that instantiates the Singleton class. Open a new Action- Script f ...
110 | Chapter 3: Singleton Pattern However, does that mean that only a single reference can be associated with the sin- gle inst ...
Minimalist Abstract Singleton | 111 This second Singleton has getter and setter methods. If we attempt to create two dif- ferent ...
112 | Chapter 3: Singleton Pattern You may be wondering how this was possible, because the second instance did not drop into the ...
When to Use the Singleton Pattern | 113 In order to provide a broad but by no means exhaustive view of how the Singleton can be ...
114 | Chapter 3: Singleton Pattern Save the file asAlert.as. As you can see, this Singleton design pattern doesn’t have to be sa ...
When to Use the Singleton Pattern | 115 When using something other thantrace( )statements in your applications, you need to impo ...
116 | Chapter 3: Singleton Pattern However, had we done that, we would have added 15 classes of excess baggage. So while we woul ...
When to Use the Singleton Pattern | 117 let it happen to your applications either. Here’s another situation where a Singleton ca ...
118 | Chapter 3: Singleton Pattern for playing the selected tune. If it finds a non-nullvalue, it means it better stop any curre ...
When to Use the Singleton Pattern | 119 The first thing to note about this Singleton script is that it imports packages and clas ...
«
2
3
4
5
6
7
8
9
10
11
»
Free download pdf