Monthly Archive for August, 2007

Flexibility Pays Off with Template Method

This is a testimonial of sorts for the capacity to easily change an application created with design patterns. Recently Adobe put up a version of a player that streams H.264 formats–these are files like Apple’s .mov and MP4, among others. After fumbling around for a while creating the files–one video .mov using iMovie and a M4a audio using Garage Band, I went to test them on a progressive download app I had handy that was set up to play audio using the Sound class and video with NetConnection(null) and NetStream. The only problem was that the streaming audio (m4a) file required a NetStream instance and would not work with the Sound class.

Because the classes for handling audio were set up around the Sound class, I thought this would be a major chore, but all I had to do was to make changes in one class. After the changes were made, it worked fine. The best part is that the structure of the Template Method did not interfere with any of the other elements in the application. So while the application may be fairly complex for the simple task of playing video and sound, when things change, as they always do, making the changes in the application were simple.

The application can be found at: http://www.sandlight.com/player9/. Keep in mind that no FLV files are used but that a genuine MOV file being played in Flash using progressive download and the sound is from a M4a file, the same file format as the ones used for iTunes–all sitting fat and happy and working. You’ll need to go to Adobe Labs and download the Flash 9 player (Beta) to see this at work.

  • Share/Bookmark

Transitioning to the Desktop with Adobe AIR

Video of Lee Brimelow’s session from AIR Camp Denver. Lee does a fantastic job of placing Adobe Air in the crowded field of Flash, Flex, Microsoft’s Silverlight and desktop apps. He demos several apps showing the capabilities of AIR apps including custom chrome and most importantly, the impressive speed of AIR apps running on the desktop, including several that use the Papervision3D library. He also shows how to create AIR apps using the excellent AIR Panel developed by the folks at gskinner.com (Note: Adobe now has an update for creating AIR apps from Flash CS3).

AIR opens a whole new discussion about best practices on developing desktop apps integrating ActionScript, HTML, Javascript and PDF and how to integrate design patterns that work seamlessly across multiple development frameworks.

  • Share/Bookmark

Composite Pattern: Extending the Book to include Composite Pages (Part II)

This is part two of a two part series on developing the structure of a book using the composite pattern. In part 1, we treated pages as primitive component objects. However, pages can be further decomposed to contain text blocks and images. This example illustrates the utility of the composite pattern by demonstrating how easy it is to extend an application that implements the composite pattern by adding new composite and component classes that extend existing ones.
Continue reading ‘Composite Pattern: Extending the Book to include Composite Pages (Part II)’

  • Share/Bookmark