The Developing an AIR ActionScript 3.0 Design Pattern Catalog and the AIR Magic Table

magicapp
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.

What Does a Design Pattern Catalog Need?

Right off the top of my head I came up with the following elements for a quick look-up:

  • Class diagram
  • Description of what elements vary
  • Component roles
  • Common usage
  • Chapter/Blog reference
  • Key Code examples

The catalog is meant to be a quick reference for someone who has some idea design patterns and wants to check out some elements of different patterns to see if it’s appropriate for a project. It is not meant to be a complete reference and certainly not a tutorial. Like the little AIR application that brings up the principles in abbreviated format, this application is meant to be a simple guide that will save time over pouring through Web searches or books and articles for basic design pattern information. Figure 1 shows an idea of what each page of the application would look like (given the above criteria). We’d like your comments on further ideas both in content and design. I’m not a designer.
catalog

Figure 1: Proposed Template for ActionScript 3.0 Design Pattern Catalog

Take a look at Figure 1 and see if you have any suggestions as to how we could make it more useful without going into a detailed explanation of the pattern. Would it be handy? Should anything be added or deleted? Is there a better design? Send in your comments.

The Magic Table in AIR

A while back we had a post on this blog that included what I called The Magic Table. It is a reference to the Gang of Four’s table where they list all of the design patterns and what can vary for the pattern. Anyway, I’ve always found that table useful, and so I created one using a simple DataGrid component. You can download it here. You can put the AIR app on your desktop and quickly find what can vary with each design pattern. Figure 2 shows what you’ll see.

vary

Figure 2: Encapsulate what varies—Design Pattern Variation Table in AIR

If you can make something with better aesthesis, please do so, and we’ll be glad to make it available to our blog readers if it is sent in an AIR file. In the meantime, we’d like to get your comments on the utility of such tools and ideas to improve them.

6 Responses to “The Developing an AIR ActionScript 3.0 Design Pattern Catalog and the AIR Magic Table”


  • I like the idea. Perhaps have a short written summary of the pattern also, like the Gang of Four’s book has on the inside of the cover. Also, would be great if the app content was searchable right from the start.

  • Hi Jens,

    I like the summary idea. I planned to use a simple List component (sort of like the Principles app) for finding the patterns. You were thinking of a more detailed search? What would you suggest searching on? Things like typical uses, component names? Please expand on that idea.

    Kindest regards,
    Bill

  • Hi Florian,

    That is a very nice chart/set of cards summarizing design patterns. Do you have any suggestions for the template we’re building for the AIR app Design Pattern we’re building?

    Thanks,
    Bill

  • Sorry, I don’t really have any suggestions… Maybe some use cases for each design pattern?!

    What I really would like to have is an intelligent pattern search engine. Which is able to type in my requirements and it gives me some design patterns suggestions… But I think it is too complicated to realize.

  • Hi Florian,

    Having a searchable app that would suggest design patterns for different projects would be a nice one. All I was hoping to have was a quick catalog. We have some room for suggested use cases in the current template.

    Setting up a database with different use cases would not be that difficult and that might be a future project.

    Thanks,
    Bill

Leave a Reply