ActionScript 3.0 Design Patterns
60 | Chapter 1: Object-Oriented Programming, Design Patterns, and ActionScript 3.0 Figure 1-10 shows some possible future extens ...
Your Application Plan: It Ain’t You Babe | 61 Choosing the Right Design Pattern Choosing the best design pattern for a particula ...
62 | Chapter 1: Object-Oriented Programming, Design Patterns, and ActionScript 3.0 introduction to OOP, you will find what some ...
PART II II.Creational Patterns If the Lord Almighty had consulted me before embarking on creation thus, I should have recommende ...
Figure Part II-1. Model of creational patterns Creational Patterns Conceal creation process from instances (objects) Encapsulate ...
65 Chapter 2 CHAPTER 2 Factory Method Pattern 2 As experimentation becomes more complex, the need for the cooperation in it of t ...
66 | Chapter 2: Factory Method Pattern ordependencybetween theClientandProductclasses. Simply put, theClientclass depends on the ...
What Is the Factory Method Pattern? | 67 To add a new product, we’ll have to modify thesimpleFactory( )method and add another IF ...
68 | Chapter 2: Factory Method Pattern The primary responsibility of the factory method is to instantiate and return product obj ...
Minimalist Example | 69 addition, commenting the classes and methods that should behave as abstract is also important. It must b ...
70 | Chapter 2: Factory Method Pattern Theexamplepackage contains theProduct1andProduct2classes that implement the IProductinter ...
Minimalist Example | 71 The product classes are defined asinternal(the default class attribute in Action- Script 3.0). This mean ...
72 | Chapter 2: Factory Method Pattern Note that thedoStuff( )method in theCreatorclass is declared aspublicbecause we need to a ...
Hiding the Product Classes | 73 We get the following output after running the project. Creating product 1 Doing stuff with Produ ...
74 | Chapter 2: Factory Method Pattern // instantiate concrete products var p1 = new Product1( ); var p2 = CreatorB.factoryMetho ...
Example: Print Shop | 75 The class structure is very similar to the minimalist example shown in Figure 2-3. The products will be ...
76 | Chapter 2: Factory Method Pattern Example 2-9 and Example 2-10 show the two concrete print job classes that imple- ment the ...
Example: Print Shop | 77 Example 2-12 and Example 2-13 show the LowVolPrintCenter and HighVolPrintCenterclasses that extend the ...
78 | Chapter 2: Factory Method Pattern Clients Note that the client doesn’t know what specific printers the copy shop has in use ...
Example: Print Shop | 79 We added two new classes, but didn’t have to modify existing code at all. We added a new product class ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf