Archive

Archive for July, 2009

The World Cup Golden Lunch Bucket!

woldcupglb
After looking at the first two Golden Lunch Bucket Contests, making this a wider event seemed like a good idea. So, I tallied up the different winners and their countries, and came up with a table reflecting winning entries. Each Grand Prize got four points, first place got three points, second place got two points and third place got one point. Then I put them in a table and thought that looked like fun. Currently, Finland is in first, the UK and Brazil are tied for second, and the US is in third as you can see in Table 1. We’d further like to encourage more participation; so Golden Lunch Bucket Contest #3 is pretty simple—requiring only a useful example of the Mediator. As we run more Golden Lunch Bucket Contests between now and next July (2010), more people can participate. Also, by adding .5 points toward their country’s World Cup total for Honorable Mention entries (those who entered a contest but were not in any of the four winning categories), we hope to encourage more entries.
Read more…

Share
Categories: Contests

The Mediator at Work: Golden Lunch Bucket Contest #3!

Categories: Contests

ActionScript 3.0 Design Patterns/OOP/Principles and Algorithms: The Forest and Trees of Programming

I’ve been working on documentation, and I began thinking about the concepts of design patterns/OOP/principles and algorithms as the forest and trees, respectively. The documentation involves Server Side ActionScript (SSAS, which is ActionScript 1.0) and good old ActionScript 3.0 on the client side. (In this context, client refers to the client making requests from the server, and not Client as a class that makes requests from other classes in a design pattern.)

In previous posts I’ve admitted to being an algorithm junkie, and for the last several days that’s exactly the habit I’ve been feeding. Since I was documenting SSAS—ActionScript 1.0— which has no user classes or typed data, I can say with a straight face that I really didn’t have a lot of choice. However, the client side work with AS 3.0 could have been more OOP-like and maybe a little Strategy pattern could have been used just to get everyone off on the right foot.
Read more…

Share

Move the Cheese: A non-Flex Actionscript example of a PureMVC Multicore Application

Although it may be a small conceptual leap for someone who has experience with the single-core version of PureMVC to visualize how multicore works, it can be a little daunting for a novice. This post describes the design and development of a simple game concept to exemplify the utility of PureMVC multicore. This is a pure AS3 app that doesn’t use the Flex framework. You can download the source and build the app  in Flex/Flash Builder (as an AS3 project) or Flash CS3/4.

DEMO

VIEW SOURCE

DOWNLOAD

The basic difference between single-core ( now known as the standard version ) and multicore is that multicore allows multiple MVC triads (multiple cores in PureMVC parlance) to be embedded inside a single application. The general recommendation is to use PureMVC multicore for all projects as it affords a lot more power in terms of developing modular applications and unit testing. However, developers who are new to PureMVC should first develop a simple single-core application first to get familiar with the framework. My previous PureMVC post describing a minimalist example will get you started with the basics. From here onwards, I’m assuming that you have a basic understanding of how the standard version of PureMVC works.
Read more…

Share
Categories: MVC, PureMVC

Golden Lunch Bucket Contest #2 Winners!

This time around we had fewer entries, but the quality was sky high! So instead of four prizes, we only have the Grand Prize and First Prize. Also, we decided to put all winning entries together with previous contests so that you will have a full selection. Download winning entries. In addition to photographs, we also included national flags.


goldenbucketgrand

timofinlandflag50Timo Hannelin, Finland
Timo was the 2nd Place winner in our last contest, and this time he moved up to the Grand Prize—and a well-deserved win! Using a MVC framework, Timo created a Hello World message in a wide variety of languages including Czech, Yoruba, Tagalog, Bemba and others! I believe you will find Timo’s entry instructive in how to create an international greetings in such a way to make it very easy to add more language classes. Anyway, congratulations to Timo again, and as they say in Basque—Kaixo Mundua!
goldenbucketfirst

spajonukflag50
Stéphane Pajon, Birmingham, England
Stéphane used the Factory Method Design Pattern to create a rich combination of expressing Hello World! Included in Stéphane’s mix is Arabic, along with Arabic script, all tucked into a Product subclass. ( رحبا العالم ) Even though your system may require Arabic, take a look at it anyway—along with the other languages Stéphane included.

Share
Categories: Contests

ActionScript 3.0 Design Pattern Catalog: Creational Patterns

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

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

download

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.
Read more…

Share
Categories: Catalog, Factory Method, Tools

Deciding on a Design Pattern: A Graphic and Text Catalog

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:

catpage
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.
Read more…

Share
Categories: Catalog

Free Flash & Flex Developer's Magazines

Another Source for Some Good Design Pattern Information

I received an email from Ewa Samulska providing a link for downloading several issues of the magazine she edits, Flash & Flex Developer’s Magazine. You can get your PDF copies at http://www.ffdmag.com/prt/view/free-issues.html .

The magazine is written for three levels of developers—beginners, intermediate, and advanced. I’ve found useful information on all levels. I’m still getting used to the Flex IDE, and I’ll take any help that I can get on it, and I’m always willing to learn more about Flash. Many of the articles cover Flash and Flex used with other technologies or programming language, and that’s something else I find always helpful.

However, it was the MVC article I found that caught my interest in the 2/2009 issue. It’s a nice description of MVC and using the Cairgorm Framework. Anyway, poke around at the site, and you’ll find several issues you can freely download. Not only will you find the articles well-written, I liked the professional layout and graphics.

Share
Categories: Design Patterns