ActionScript 3.0 Design Patterns

(Chris Devlin) #1

62 | Chapter 1: Object-Oriented Programming, Design Patterns, and ActionScript 3.0


introduction to OOP, you will find what some consider thecorrectway to under-


stand OOP. (Others might even contend that it is theonlyway to understand OOP.)


We spent time on OOP because a sizable portion of ActionScript programmers may


not have gotten around to its use yet. After all, ActionScript itself is relatively new to


OOP structures.


Alternatively, if you’re an old trooper with OOP, either from ActionScript or another


language such as Java or C++, we hope that our discussion of design patterns will


help you better apply OOP concepts in a design pattern.


Whatever your background in OOP, the Gang of Four recommend the following


design patterns for those of you who are relatively inexperienced in object-oriented


programming:



  • Adapter (Chapter 5)

  • Composite (Chapter 6)

  • Decorator (Chapter 4)

  • Factory Method (Chapter 2)

  • Observer (Chapter 8)

  • Strategy (Chapter 11)

  • Template Method (Chapter 9)


However, if these patterns seem in any way daunting, do not worry. We don’t know


of anyone who fully grasped design patterns on the first go-around, including the pat-


terns suggested by GoF. We certainly didn’t. However, by using, changing and experi-


menting with the examples we have provided, along with going over the explanation


of OOP and design pattern concepts in the chapters, we believe that you’ll come to see


them in the same light as we do—the best friend a programmer could have.

Free download pdf