FlexManiacs - Jim Robson - Managing Complexity with Cairngorm

Jim has been working with Flash since 1999 when Flash 4 was new.

As applications develop, requirements grow and complexity increases so it is important to be able to add new facilities. Cairngorm makes it easy to collaborate on a single file or projects. It makes it easy to find things in your code and add new features.

Every time you use Cairngorm you have to add the Cairngorm Library to the build Path in project properties. Ant can be used to create the application skeleton to save a lot of typing. Eric Feminella has written some Ant Scripts, which create several objects needed by the framework. Several folders are created with Actionscript files in each already.

  • business
  • commands
  • control
  • events
  • model
  • vo

In the class we created a news reader which would take newsfeeds from Reuters. There were one or two problems keeping up with the class. (I am not used to the US keyboard.)

www.cairngormdocs.org is the place to go for the full description of the framework.

My overall impression was that there does seem to be more overheads here than is really necessary for a simple application and I am concerned that with a really large application the huge number of files will grow and make it difficult to maintain things.

At lunch I talked with Mike and Angie Nimer who have some experience of using Cairngorm. They confirmed my thoughts and both said that there is a heavy price to pay in terms of extra overhead required in order to build an application with Cairngorm.

Comments
Alistair McLeod's Gravatar Hi Jim,

Using Cairngorm to build something as simple as reading a newsfeed does seem like overkill and if I were teaching a basic course, I'd not include the framework in the material as it introduces questions not about the main content. Have you read Steven Webster's posts on when to consider not using Cairngorm?

http://weblogs.macromedia.com/swebster/archives/20...

Thanks,

Alistair
# Posted By Alistair McLeod | 6/26/07 5:32 PM
Mark's Gravatar Hi Jim,

For Sample applications Cairngorm is overkill, however a sample is really there to explain how Cairngorm is used.

I have found Cairngorm extremely useful for any flex application from moderate to increasing complexity. Where it excels at is making the developer think in best practise design patterns...

So where I might normally, put an array collection in a Component, say to store an array of tags for my RSS reader, if its in the model, later I can reuse the same array collection later on in a different view type component.

Also I found it very useful for maintenance of flex applications when the majority of code is done in the commands.

Overall it does provide an overhead, but one that helps the developer in the long run. And Ant based Cairngen from Eric is a HUGE time saver...
# Posted By Mark | 6/26/07 6:26 PM
James Chow's Gravatar I'd just like to say that, even on small scale or medium scale applications i would probably still use it. because it helps keep code organised. And even if it doesn't fit your current application, you can still use some of the principles that it has laid out.
# Posted By James Chow | 6/26/07 10:24 PM
Mike Britton's Gravatar With all due respect, I've always been of the opinion that any framework is better than none. While many may disagree with using Cairngorm for small projects, it sure makes the code easier to revisit. From a dev perspective, would you rather work with someone else's code sans Cairngorm, or with it? Since most people have their own coding styles, and most devs maintain their own techniques are superior, it follows that basing any codebase on a framework, whether Cairngorm or something else (preferrably one with a good community around it), puts you at an advantage across the board.

(steps off soapbox)
# Posted By Mike Britton | 6/27/07 2:31 AM
Kevin Roche's Gravatar I guess I was hoping for somthing a little lighter. Is there any other framework for Flex? Could someone recommend something?

I am not saying I wouldn't use it but for a flex newbie it a big learning curve and since the project I am planning is non trivial perhaps Cairngorm is the best choice but I was hoping to have a choice of frameworks.
# Posted By Kevin Roche | 6/27/07 11:12 AM
Mark's Gravatar There are a few frameworks, all with their pros and cons...

http://www.ariaware.com/products/arp/ (this one has been around for a while its flash and flex framework)

There was another, based on the Gang of 4 Design Patterns but I cannot find the link at the moment... its called PureMVC...
# Posted By Mark | 6/27/07 11:39 AM
Gary Ault's Gravatar Links to two other frameworks:

http://puremvc.org/
http://www.guasax.com/
# Posted By Gary Ault | 6/27/07 2:13 PM
Kevin Roche's Gravatar Thanks Mark and Gary, I will investiagte those.
# Posted By Kevin Roche | 6/27/07 2:23 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.