The Bookstore App Meets ColdFusion 8 (aka Operation: AJAX)

I've been playing with the new AJAX capabilities in ColdFusion 8, and I'm impressed. They've really made it easy to add AJAX functionality to an application. As a personal experiment, I decided to try converting an existing page-based app into a single-page, AJAX-driven one. So as usual, I brushed the dust off of my tried-and-true sample bookstore application and went to town.

Some of you might have seen the bookstore app before; I've had it on my site for quite a long time. It's gone through Fusebox 3, FuseQ, Fusebox 4, Fusebox 5, Mach-II, and Model-Glue:Unity versions. It was also the basis for my "Framework-Agnostic Models" presentation at this year's Frameworks Conference.

I was quite stunned to find that converting the Fusebox 5 version into an AJAX application took about 2 hours. Yes, 2 hours. Part of the reason it was straightforward was that the app already leveraged self-contained content blocks for each page element. Basically, each of the sidebar elements, the main page content, and the menu are all CFDIV blocks now. Each one updates on its own, asynchronously, using the built-in AJAX goodies in CF8.

It was interesting to see how my development approach had to change to support a more event-driven GUI. Each link or form is tied to a JavaScript event handler that determines which content elements to update via AJAX. I can see now how doing complex GUI programming is a real challenge, because this was only 8 or 10 events. I think I have some learning to do when it comes to patterns that apply more to GUI development than the patterns I'm used to dealing with in the model.

In any event, I've added this AJAX-ified version of the bookstore to the Framework-Agnositc Models Code and Presentation .zip file in the right sidebar. If anyone is interested in having a look, please do and let me know what you think.

Comments Comments (2) | | Digg It! Digg It! | Linking Blogs Linking Blogs | 7399 Views

Mach-II / ColdSpring / Reactor Bookstore Port

Matt Williams was kind enough to make the short jump to a Mach-II port of my bookstore sample application. Thanks Matt!

I hope some folks find it useful. This little app really is taking on a life of its own. ;-)

Comments Comments (14) | Download Download | | Digg It! Digg It! | Linking Blogs Linking Blogs | 7848 Views