Pet Theory header image 5

Entries Tagged as 'patterns'

Building Pet 8: Structure for an HTML-Like All-Flash Site

May 19th, 2007 5 Comments

In the first post of this series, I explained why I wanted features like long-term flexibility, deep linking, history, and background loading for my new, all-Flash playground site, pet-theory.com. I also explained why I used design patterns to meet these requirements.
In subsequent posts, I explained how it was done, focusing on one design pattern per […]

Tags: patterns · code

Building Pet 7: The Command Pattern for History

May 10th, 2007 1 Comment

When they implement history at all, all-Flash sites tend to offer history-like gestures like a Back/Home/Before arrow in lieu of the actual, click-by-click back- and forward-tracking of a browser.
This degradation of a useful and universally expected feature usually makes navigating these sites awkward, often painful.
So I decided (after preliminary reflections recorded in this post) […]

Tags: patterns · code

Building Pet 6: The Composite Pattern for a Background Loading Queue

May 10th, 2007 1 Comment

The basic operation of the composite pattern is easily grasped. Composite is another wrapper pattern that involves one object rerouting method calls to another object with the same interface.
Graphed, it looks nearly identical to the state pattern. Remember that with state, a wrapping object relays method calls to any one of a number of […]

Tags: patterns · code

Building Pet 5: The State Pattern for Loading SWF Modules

May 9th, 2007 No Comments

In a tree of modules, some modules will need to load assets when selected…and some will themselves need to be loaded.

Tags: patterns · Flash

Building Pet 4: Interfaces for Loading

May 8th, 2007 1 Comment

I was acquainted with interfaces before I read Head First Design Patterns, but their full glory was hidden from me.

Tags: patterns · code

Building Pet 3: The Mediator Pattern for App Files

May 8th, 2007 No Comments

I remember vividly the first time I opened up the Actionscript panel in the Flash IDE and wrote one line in the heretofore untouched panel:
PLAIN TEXT
Actionscript:

myApp=new Application(_root);

It was a special moment because this lightning-stab of a line both compressed and expressed a week of work. Ctrl-Enter...and...SWISH!
Between that moment and moment I cracked open [...]

Tags: patterns · code

Building Pet 2: The Strategy Pattern for Navigation

May 7th, 2007 No Comments

I wanted things for my playground--not only history, but deep linking and persistence (the site wouldn't automatically reboot when backtracked)--that made a systematic approach to navigation necessary.
At the same time, I hadn't decided on the what of the navigation (the sections), or the how of the navigation (the transitions between the sections), and I didn't [...]

Tags: patterns · code

Building Pet 1: The Need for Patterns

May 7th, 2007 3 Comments

I'm doing a week of posts on how I built my new playground site, pet-theory.com. My three-fold aim is 1) to introduce designs patterns to those unfamiliar to them, 2) to give a soup-to-nuts example of architecting a site, and 3) to suggest solutions to some problems common to all-Flash sites.
I'm no expert on patterns [...]

Tags: patterns · code

back-button design-pattern options for Flash

October 17th, 2006 2 Comments

I always figured it was laziness when Flash designers omitted the back button...until I considered implementing one myself. Then I realized that this is another case where the wide-open freedom of Flash leads you directly to ground-up difficulties.
The back-button works so naturally in a browser because HTML presupposes one kind of transition: one page replaces [...]

Tags: interface · patterns · code