ActionScript 3.0 Design Patterns
400 | Chapter 11: Strategy Pattern say that the Context class (aggregator)ownsthe Strategy interface (aggregate), just as in the ...
Key OOP Concepts Used with the Strategy Pattern | 401 function balloonAnimals( ) { //balloon animal code } } class Bojo extends ...
402 | Chapter 11: Strategy Pattern between thecontextclasses and the strategy classes. The context classes are made up of a clas ...
Minimalist Abstract State Pattern | 403 Using Delegation with the Context TheContextclass shown in Example 11-1 is an aggregator ...
404 | Chapter 11: Strategy Pattern More Delegation in a Concrete Context In a concrete context class as in Example 11-4, you can ...
Minimalist Abstract State Pattern | 405 Now that you have an abstract Strategy design pattern where you can see the arrange- men ...
406 | Chapter 11: Strategy Pattern Adding More Concrete Strategies and Concrete Contexts The purpose of the minimalist example i ...
Adding More Concrete Strategies and Concrete Contexts | 407 Notice that each clown can perform only a single trick and a single ...
408 | Chapter 11: Strategy Pattern By using a general concept like “tricks,” we’re limiting the range of what the clowns can do. ...
Adding More Concrete Strategies and Concrete Contexts | 409 site extreme in that it would require a clown to do everything, even ...
410 | Chapter 11: Strategy Pattern Even though we’ve discussed some possible shortcomings in this design, it still shows how the ...
Adding More Concrete Strategies and Concrete Contexts | 411 The output represents the algorithms set up in the strategy classes. ...
412 | Chapter 11: Strategy Pattern Adding a new trick Just as adding a new concrete context class in a Strategy pattern is easy, ...
Adding More Concrete Strategies and Concrete Contexts | 413 Nothing will change for the first two clowns. However, the new clown ...
414 | Chapter 11: Strategy Pattern Simply by adding setters to the context class, the application has been given a dynamic way t ...
Working with String Strategies | 415 With any application, you’re likely to encounter recurring algorithms. For this appli- cati ...
416 | Chapter 11: Strategy Pattern Contexts for String Strategies You can think of the context classes as theclientsfor the stra ...
Working with String Strategies | 417 stringWork( )andsortWork( ). These references are then used to specify exactly which of the ...
418 | Chapter 11: Strategy Pattern Even with the added parameter and the return datatype, the interfaces are very sim- ple. They ...
Working with String Strategies | 419 Instead of using simple string comparisons, you could use regular expressions. Far more sop ...
«
17
18
19
20
21
22
23
24
25
26
»
Free download pdf