Cairngorm with Michal Glowacki at NYFlex!

I am a big fan of frameworks in general. Using an established framework helps structure an application. Structured applications are much easier to understand and maintain. Additionally, using a framework can make programming an application easier, quicker or a combination of the two.

In the Flex world there are two main frameworks ARP and Cairngorm. I am very much interested in gaining proficiency in both frameworks and I admit to not having put much time aside for experimentation and learning.

Cairngorm, the framework with the funny name (unless you are either Scottish or are familiar with the Cairngorm Mountains in Scotland) , has appeared somewhat daunting to me. I could be a better actionscript programmer and while I am actively working to improve my skills I haven't felt the pain of not using a framework for my Flex applications so far.

On Feburary 15th, Michal Glowacki, a senior Flex programmer at MotionBox gave a presentation on 'Moving to Cairngorm' to an extremely packed New York Flex User group. Michal showed examples of a simple Flex application built using different methods. Next he touched on the difficulties in maintaining applications built by different developers with different interpretations of Flex.

Following that, Michal build a simple Flex application using the Cairngorm framework in 15 minutes. Watching this process was the perfect demonstration of how the framework parts fit together. Whereas before, I was confused on how to apply the Cairngorm terminology to my applications, I am now quite clear on how Cairngorm applications function and work. I have newfound love and respect for the Cairngorm framework!

Keeping track of state, events, services models, etc.. add to the code clutter in an application. Using Cairngorm will alleviate a lot of the noise and messiness in Flex source code. At least, in my Flex application source code ;)

You can find some interesting articles on Cairngorm here

Thank you Michal for your excellent presentation on Moving to Cairngorm and thank you to Shlomy Gantz for his continual efforts in making NyFlex the premier Flex User group.

Related Blog Entries

Comments
Funny, I actually have an article on Cairngorm coming out soon that approaches it from the perspective of workflow, which I think helps illustrate what the pieces do and why they are needed.

Also, FWIW, I thought the framework was named after the type of crystal found in those mountains and not the mountain range itself.
# Posted By Brian Rinaldi | 2/24/07 10:28 PM
I have deep reservations about Cairngorm. I'm even starting to think that its Singletons represent antipatterns. I'd love to see a walkthrough or discussion of Cairngorm workflow and how it is better than what you get out of the box from Flex. Brian, where is your article to be posted? On your blog???
# Posted By notboss | 2/25/07 9:50 AM
@Brian,

Your articles are always clear and insightful and I am glad to hear you have an article on Cairngorm coming out soon.

As far as the origin of the name, you could very well be right. It would be interesting to know, do you have any links perchance?

@notboss
I use the singleton pattern in my regular back-end development and find it offers some distinct advantages. In ColdFusion, object creation can be a little heavy at times and caching an instantiated service component or other singleton makes a difference in performance. Since ActionScript 3 is compiled and strongly typed, I doubt the performance benefits carry over. Can you be more specific about how you feel about the singleton pattern being an anti-pattern? In what ways do you feel the Cairngorm usage of the singleton pattern is incorrect?

I welcome all thoughts and don't pretend to have all the answers on this one...


dw
# Posted By Dan Wilson | 2/25/07 12:54 PM
Well, it was submitted for the upcoming FAQU, though I am not sure if/when exactly it will be out.I think reading about Cairngorm leads you to think it is pattern overkill, but once you use it for large applications you realize each piece is fulfilling a vital requirement.
# Posted By Brian Rinaldi | 2/25/07 10:58 PM
Hi Dan,
I'm very skeptical about ModelLocator and FrontController. I don't believe a single global model is a scalable idea in a medium, let alone large, application - even with only 5 different screens. And I dont believe it is scalable to centralize all state management in one place. In general I prefer dependency injection and hierarchical state management. Still, some people seem to like Cairngorm so I'm anxious to see/read more about how they are actually using it.
# Posted By notboss | 2/26/07 8:17 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.001. Contact Blog Owner