Design Patterns in ActionScript 3

Day 2. Session 3. Luke Bayes and Ali Mills talk about what they describe as the most powerful design pattern: the Composite Pattern. While I believe Flex incorporates most if not all of the facets of this design pattern, these 2 gentlemen have set up their own framework to satisfy their needs. Their framework consists of 3 fundamental classes, which can be extended to form the components of your application.
* Component - the basic building block, the component includes propertied and functions to render the visuals of a UI button, text field, etc.
* Composite - extends a component, and thus has the same layout functionality, but also includes the capability to contain other components as child nodes. This is more commonly referred to as a container.
* Application - extends a composite, but acts as the outer-most node in a swf. This class is unique as it responds to stage events instead of a parent composite.
The whole point of design patterns is to build better OOP code.
Tip: set your debug URL for a Flex project to the SWF instead of the HTML to have it load in the flash player instead of your browser.

Tags:

Post a Comment

Your email is never published nor shared. Required fields are marked *

*

*