The Fearless ActionScript 3.0 Design Pattern Catalog Soldiers On
I was able to get the second installment of the ActionScript 3.0 Design Pattern Catalog finished. For a running start, you can see the Creative/Structural Catalog online. As you will recall, in the First Part of the Catalog project, I used a dual-factory framework for creating the patterns. Other than the work adding new text files and drawing the class diagrams, updating was a piece of cake. I had to make changes to the CatData.as file to add the names of the Structural patterns, but otherwise, all I did was fill out text files. It was like magic. Everything else just took care of itself. (It’s always nice to see design patterns at work!) Figure 1 shows the progress:

Figure 1: The Added Structural Classes
It doesn’t look any different than the original other than the fact that it now has more than twice as many design patterns.
AIR Version Available
Ben Beaumont helpfully pointed out that instead of trying to grab 156 individual files, I could just grab the two type folders (Creational and Structural) in the AIR version and it worked fine. Click the download button to get the AIR Design Pattern Catalog for a very handy reference on your desktop:

I put the files online so that you can download them to see how everything works together. You will notice that they’re the same as the initial set except you now have a lot more patterns.

If you feel creepy for not helping out, you can be a big help by proof-reading the content and see if mistakes were made. (If you find any, send them to me, and I’ll fix them.) Also, it would be über cool if someone could translate the text files from English into other languages. I’d like to put up editions in as many languages as could be contributed.
In the meantime, enjoy the updated catalog.
A Tale of Two Factories: One New and One Reused
This is the first of three posts on the actual AIR ActionScript 3.0 Design Pattern catalog. Previously, I had discussed the thinking that went into the design of the Catalog, and here is the first actual AIR application with the Creational Patterns portion of the catalog all set up and ready to use. Figure 1 shows what each page looks like: (By the way, the actual image in the catalog is almost twice the size as what you see in Figure 1.)

Figure 1: Design Pattern Catalog Page
Before going on, you can download all of the source code and the AIR application by clicking the Download button. Additionally, you may want to access the Catalog Online.

I changed the color combinations. I concluded that Kuler’s 1944mustang color set was the best for this project because I needed a white background and I liked the orange for highlight. I used red for labeling on the diagrams, but it was used sparsely and provided a consistency.
Continue reading ‘ActionScript 3.0 Design Pattern Catalog: Creational Patterns’
How to Decide on a Design Pattern
I don’t want to beat around the bush here, so I’ll just come right out and say it,
Choosing a design pattern can be tricky.
For most of you, this is nothing new. Even with the help of the Magic Table that shows what varies for each design pattern, I find that while the table is useful for eliminating certain patterns, it’s not as useful for pinning down the exact design pattern that should be used. So here is a case where you, as a reader, can help decide which pattern is best suited for creating the design pattern catalog that will be placed into an AIR application.
First, let’s look at the goal. Based on feedback from this blog, the conventions established by the Gang of Four as well as what I found useful, I came up with what each catalog page will display, as shown in Figure 1:

Figure 1: Mockup of Catalog Page
The idea is to have a single page with all of the data externally loaded. The class diagrams are to be a graphic image (including the text in the diagram), and everything else will be text. The text fields will either be for headers or body text, and the body text will have styles for normal text and code text (Arial for the former and Courier New for the latter). The color scheme, “Dusty Petrol” from Kuler, seemed to be a nice combination of colors without any jarring contrasts.
Continue reading ‘Deciding on a Design Pattern: A Graphic and Text Catalog’

Gentle Reader, this post includes one completed application and one in the works. The AIR ActionScript 3.0 Design Pattern Catalog is meant to be a developer’s aid, and so your ideas of what to include in the catalog is important. We would really appreciate your comments on what you think would be useful in developing an information template to be used for all of the design patterns.
I recently returned from a trip to Prague in the Czech Republic, and I went to work creating a video player for my HD videos I made using a Flip Mino HD camcorder (http://www.sandlight.net/prague). Rather than pulling out and reusing my trusty State Design Pattern player (see Chapter 10), I decided to start from scratch and create a player not using a design pattern. Then I would take the completed video player and use it as an example to show how to refactor a program to a design pattern. (This will be in an upcoming post.) Since I’ve never had to refactor the original program (tweak, maybe but not refactor), and I hadn’t worked with a State pattern lately, I found myself digging up all of the materials on the State Design Pattern. What I wished I had was a handy desktop app that I could click that would show me the essentials of the different design patterns. It would be an abbreviated design pattern catalog that could be used like the little Design Pattern Principles and Lunch Bucket Rules AIR app. Then when I need a quick reference I could use the desktop app to look up the essentials of the pattern.
Continue reading ‘The Developing an AIR ActionScript 3.0 Design Pattern Catalog and the AIR Magic Table’
Recent Comments