
Getting Started in Design Patterns Can be Daunting
What are Design Patterns?
So as not to create false expectations, Design Patterns will not make your programs run faster or better. They were developed to aid in creating object oriented programs that can be reused and easily changed and updated. One of the side benefits is that they aid in understanding Object Oriented Programming (OOP); so, if you leap into design patterns, you’re leaping into OOP.
They’re not easy, but don’t let that scare you. Some are easier than others, and by starting with the easy ones, the more challenging ones will come in time.
They payoffs are huge. If you’re reading this line, it means you’re not afraid of expanding your mind beyond what you thought you could do in programming. Once you’ve figured out ‘Hello World’ level programming and discovered the beauty of a good algorithm, it’s time to look at the bigger picture. So let’s get started!
Always Start and End with OOP Principles
OOP Principles and Design Pattern Principles are virtually the same; so to help you get started with OOP Principles, we’ve organized all of the links to the principles in one place-> Here!
Also, for your desktop, you can use the AIR applications that contain a summary of critical information:

- Principles
- Program Variation and Design Pattern
- Design Pattern Summary (still under construction but useable)
You can download all of the AIR applications here.
Books
Learning Design Patterns requires patience, and books are about the most patient tools around. Here are three we find helpful:
- ActionScript 3.0 Design Patterns. Of course we’re going to recommend our own book. We wrote it with ActionScript programmers in mind. The best part is that you don’t have to convert the examples into ActionScript 3.0—that’s already been done. (Also available for iPhone.)
- Head First Design Patterns. This book takes your head on a fun tour of design pattern thinking. The examples are all in Java, but it’s not too difficult to work through with ActionScript 3.0.
- Design Patterns: Elements of Reusable Object-Oriented Software. This is the book that launched programming design patterns. The examples in SmallTalk are difficult to convert into ActionScript 3.0, but the other materials are rich enough in detail so that you can create your own examples.
In addition to those books, look for good books on OOP and Design Patterns. However, if we had to recommend a core Design Pattern/OOP Library, those three books serve as a core.
Magazines and Online Sources
While we’re on the topic print material, you will find a good online magazine Flash & Flex Developer. (http://ffdmag.com/) This magazine used to be a pay-to-subscribe paper publication. However, they changed to free digital format (PDF). The quality has remained high as they have switched to this new format. In a couple of issues I’ve written articles on Design Patterns that are designed for beginners. (5/2009 and 6/2009).
Occasionally, you can find an ActionScript 3.0 Design Pattern article at the Adobe.com site, but not as many as we’d like to see. Also, we’d like to see more blogs dedicated to ActionScript 3.0 Design Patterns. If you find any, we’d like to hear about them.
Finding What You Need on This Blog
With well over 100 posts and over 1000 comments (at this writing), we have to revise our categories and add indexes occasionally. Also, we have posts like this one to try and gather up the collected wisdom and offer starting places for new readers. Please add any suggestions you have in the suggestion box on the right side of this blog -> if you have any ideas for finding materials or topics you’d like to see. Finally, at the bottom of every post you will see a list of related posts. Usually, you can find what you need, but if you still cannot, use the search window at the top of the blog. Your comments are always welcomed!

The ActionScript 3.0 Design Pattern Starter Kit by William B. Sanders, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

Bill Sanders
Great article.
The air apps on the link “You can download all of the AIR applications here.” doesn’t seems to be in place for a download.
Hi Flashbookmarks,
You should be able to see all three AIR apps. Just right-click (control + click on the Mac) on the file names (they all end in .air) and select Download Linked File.
Once you have downloaded them, just double-click them to install them. Let me know if that works for you.
Kindest regards,
Bill
Thanks for your great resource Bill, I can’t seem to get the air files to download either. I’ve tried accessing the URLs of the files directly, and they don’t seem to exist.
Thanks!
Alistair
Hi Alistair,
Ok gentlemen, I put them all together at the same URL in a ZIP file (starterKit.zip).
Let me know if that works for you.
Kindest regards,
Bill
Hi Bill,
About the design pattern principle “Favor object composition over class inheritance”, if for example one class is the 3rd subclass of the MovieClip class (classA extends MovieClip, classB extends classA and classC extends classB), we will have 9 subclass from the Object class, it is more than 2 hand’s fingers of Mickey.
Will it be a bad design ?
Patrick
Hi Patrick,
It’s always important to keep in mind what the principle attempts to do. (Also, keep in mind that those little ‘reminders’ are not literal translations!)
My own rule of thumb is to only subclass from an interface or abstract class–implement or extends. That’s also the Liskov Substitution Rule.
If you’re subclassing beyond an interface (including abstract classes) you’re making it tighter and more difficult to change. So, I would definitely not have subclasses from concrete child classes.
It’s funny you should bring up this query now, because the other day, I was taking apart a MovieClip of a truck I had made some time back. I created a separate class for each of the parts and I found that I could more easily control it and changing was quite easy as well. The composition was in taking instances of the different parts and reassembling everything. Then if I wanted to use any of the timeline commands, I’d simply use addFrameScript() and control it with AS3.
Take care,
Bill
Hi Bill,
Now I think that I was wondering that because it looks a bit strange that the as3 native class seems to be made with a lot of inheritance.
When we see all this inheritance it’s a little bit hard to think that inheritance is not neccecary a good thing.
Maybe as3 native are like that because they are for a more definite use and not will change, they are tools for all the user of flash and in that it’s a “fixed” structure ?
Patrick
Hi Patrick,
I’ve wondered about the same thing myself. The inheritance in a language is organized with a different mission than design patterns in an application. However, you will find certain design patterns even in languages. (I believe there’s a Template Method tucked away somewhere in ActionScript 3.0.)
The structure is “fixed” and I’d certainly be nervous about a language that wasn’t. At the root of the classes is the Object class; however, you will find other Top Level elements as well.
Amicalement,
Bill
Hi Bill,
Thank you to confirm my feeling ! Then maybe it have an influence on how widely the beginner uses inheritance.
I was really impressed by the image of the painting of E. Manet with the word “interface” above the soldiers, maybe they are the interface between those who gave the order and the sentenced ?
In your Air Catalog I can only see the creationnal patterns, are the other not already in the catalog ?
Amicalement aussi,
Patrick
Hi Patrick,
The Air Catalog is a project I started and invited others to help out if they wanted. So far no one has jumped in, and so I’ve just had time to get the first set of design patterns done. I’ll get going on the rest.
The Manet painting has a wall representing “encapsulation” and variation resides on the far side of the wall! (Who knew that Manet could be so helpful?)
Kindest regards,
Bill
Hi,
For the catalog I was just wondering if I didn’t understoud how to see the other.
With my knowledge of design patterns I could not help a lot on that project.
I didn’t interpreted well the meaning with the painting, though interface was the soldiers :)
I very apreciate your comparison between oop and reality.
Patrick
Hi Patrick,
Why not translate the text files to French? We’d love to have it in French as well as English.
Bill
Hi Bill,
Yes, good idea, je vais faire ça !
Patrick
Patrick,
Thank you very much. Merci beaucoup! When you send them to me, we will put them on the blog so that everyone from Paris to Québec can get them.
Amicalement,
Bill