Navigation Menu




I Think I "Get" Cairngorm!


By Sean Corfield
Expert Author
Article Date: 2007-10-22

Every time I've looked at Cairngorm, it's always seemed complete overkill to me. It's why I was so pleased to see Joe Rinehart start working on Model-Glue for Flex.


Cairngorm made Flex development look much harder than I wanted to believe it really is. It's been years since I had to build desktop applications with a full event-driven, multi-threaded architecture and I finally realized on the way home from MAX Europe that web development has truly spoiled me. Web development - by which I mean pure HTML application development - is so much simpler than desktop development.

I'd been trying to approach Flex from that point of view as well. On the way back from MAX I started to build a Flex version of my startup's website. This is actually the second time I've tried to do this. The first time was not a very successful experiment and, at the time, I wasn't really quite sure why. This time I was following the information I'd learned in Joe Berkovitz's sessions and so I knew I'd have multiple controllers, multiple services and multiple models and that I'd be using events a lot. It meant I'd be writing a lot more AS3 classes and trying to do a lot less in MXML.

It was at that point I finally realized why Cairngorm uses command objects everywhere: it's the easiest way to get an asynchronous remote method dispatched and still provide a stateful hook for the result handlers (since you can have multiple concurrently active requests to the same remote service). Of course, it doesn't really need command objects per se, it just needs a context for each async call. A command object is just a reasonably convenient way to package that.

As I've done in the past, I'm going to have to work without a framework for a while and experiment with different design patterns to get a feel of where the pain points are for me and then decide what to do about them. I still don't like Cairngorm but I do at least fully understand the problems it is trying to solve and how it does that. I like the approach that Allurent takes (see Joe Berkovitz's slides and code from MAX) and I like where Joe Rinehart is going with Model-Glue for Flex.

Not sure if it'll make a Cairngorm user of me (if Flex Builder 3 auto-generated all the boilerplate code for Cairngorm I might be more tempted) but it will definitely - finally - make a Flex developer of me.

Now excuse me, I'm off to download FlexUnit so I can start doing some test-driven Flex development!

Comments

About the Author:
Sean is currently Senior Computer Scientist and Team Lead in the Hosted Services group at Adobe Systems Incorporated. He has worked in the IT industry for nearly twenty-five years, first in database systems and compilers (serving eight years on the ANSI C++ Standards Committee), then in mobile telecoms, and finally in web development. Sean is a staunch advocate of software standards and best practices, and is a well-known and respected speaker on these subjects. Sean has championed and contributed to a number of ColdFusion frameworks, and is a frequent publisher on his blog, http://corfield.org/


Get Your Site Submitted for Free in the World's Largest B2B Directory!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions

AppDevNews
FlashNewz
DevWebPro



Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact | Site Map

ApplicationDeveloperNews is an iEntry, Inc.® publication - 1998-2008 All Rights Reserved Privacy Policy and Legal

I Think I Get Cairngorm