ActionScript 3.0 Design Patterns
240 | Chapter 6: Composite Pattern Calculating the Total Weight of the Airplane Line 56 of theMainclass shown in Example 6-25 ca ...
Using Flash’s Built-in Composite Structure: the Display List | 241 Modifying Components to Reflect Damage We will modify the com ...
242 | Chapter 6: Composite Pattern Example 6-27 shows the modifiedMainWingclass. Note the conditional statement in lines 22- 26. ...
Summary | 243 private function showDamage(evt:Event) { trace('Total damage: ' + airPlane.getDamage( )); } Clicking on the stage ...
...
PART IV IV.Behavioral Patterns People’s behavior makes sense if you think about it in terms of their goals, needs, and motives. ...
The key to the Behavioral patterns is the allocation of responsibilities through either inheritance or object composition. First ...
247 Chapter 7 CHAPTER 7 Command Pattern 7 To command is to serve, nothing more and nothing less. —Andre Malraux When you do the ...
248 | Chapter 7: Command Pattern Notice the tight coupling between the client and the receivers. By coupling, we mean the degree ...
What Is the Command Pattern? | 249 task. Figure 7-1 shows the household equivalent of a command interface. Mom’s command interfa ...
250 | Chapter 7: Command Pattern Each envelope encapsulates a particular behavior that’s assigned to a particular receiver. The ...
Minimalist Example of a Command Pattern | 251 The client assigns eachConcreteCommandinstance to specific triggers ininvokers. In ...
252 | Chapter 7: Command Pattern instance is passed to the constructor, theConcreteCommandclass andReceiverclass are loosely cou ...
Minimalist Example of a Command Pattern | 253 The Client Example 7-5 shows theMainclass (also thedocument classfor the Flash doc ...
254 | Chapter 7: Command Pattern Setting a Trigger to Invoke the Command In most situations, the client does not call theexecute ...
Minimalist Example: Macro Commands | 255 Key OOP Concepts in the Command Pattern The key concept in the command pattern is encap ...
256 | Chapter 7: Command Pattern Two Concrete Subcommands To demonstrate a macro command, we will implement two concrete command ...
Minimalist Example: Macro Commands | 257 The Concrete Macro Command We will now develop a macro command that implements theIMacr ...
258 | Chapter 7: Command Pattern A Macro Command Object Created from the Client The client first creates the two subcommands. It ...
Example: Number Manipulator | 259 has Open, Save, and Save As menu items. Each of these menu items can be a com- mand container ...
«
9
10
11
12
13
14
15
16
17
18
»
Free download pdf