ActionScript 3.0 Design Patterns

(Chris Devlin) #1

PART V


V.Multiple Patterns


A multiple personality is in a certain sense normal.
—George Herbert Mead (Describing what is normal for
programmers who attempt to use multiple design
patterns.)
Language can be abstracted, language can be used as
a very beautiful code in poetry, the nuances and the
multiple meanings of things, it has a music to it. It has
so many things in it. It is also reduced from prose and
therefore can be both mathematical, or very, very
abstract.
—Jim Jarmusch
For every disciplined effort there is a multiple reward.
—Jim Rohn
One is sorry one could not have taken both branches
of the road. But we were not allotted multiple selves.
—Gore Vidal (Describing the process in mutually
exclusive radio buttons.)

Using More Than One Pattern


The two chapters in this last part present two designs that implement more than a


single design pattern. First, we examine the Model View Controller (MVC). The


MVC uses the Observer pattern (Chapter 8) in the Model to hold the data, the View


entity uses the Composite pattern (Chapter 6) for representation of the model state,


and the Controller makes use of the Strategy pattern (Chapter 11) for the user inter-


action. Our implementation of the MVC in ActionScript 3.0 reflects the design pat-


terns suggested by the Gang of Four. Other options are possible in the MVC, such as


including Factory and Decorator design patterns.

Free download pdf