Cairngorm vs PureMVC

January 14, 2008 – 2:40 pm

As ActionScript gone into a fully fledged object oriented programming language, there are many frameworks out there developed or in development on top of AS 3. Two of the most known are Cairngorm from Adobe Consulting and PureMVC from Futurescale.

Both of them are build on top of Model-View-Controller architecture but Pure MVC is adding more weight with Facade pattern. I must admit i’ve never used PureMVC, i just read the framework overview and seems that they have some interesting stuffs right there.

For now i’m sticking with Cairngorm as it is a lightweight easy-to-use framework, real handy and very useful. One example i can give you of how useful is to use these kind of frameworks is actually driven from a mistake. Our StreamingBASE Live project, the platform for web conferencing and events started without a feature specification, that is recording the meetings and events. But the thing that saved us many hours of work adding that feature in the mid project was Cairngorm (that we used right from the start). Now how the meeting works is based entirely on events, cairngorm events. If a message is received, a cairngorm event is dispatched, if the presenter changes the layout in the meeting, a cairngorm event is dispatched on all attendees, and so on and so forth. With this structure, adding record feature was a simple task of storing some cairngorm events with data and re-dispatch those in the same order in the playback. Simple and nice, whew. Good work Cairngorm :)

Back to our topic here are the diagrams for both frameworks:

Cairngorm: http://blogs.eyepartner.com/adrian/images/cairngorm2_rpc.gif
PureMVC: http://blogs.eyepartner.com/adrian/images/pure_mvc.jpg

If you used both (or at least one) of them, what do you think the ups and downs are ?

  1. 11 Responses to “Cairngorm vs PureMVC”

  2. Both have their strong points, but Cairngorm is still the defacto-standard for most organizations (because of its support from Adobe). I have even had a few clients that “wanted Cairngorm and nothing else”. For projects where you have a choice, I would choose a framework based on its strengths, but every Flex developer needs to know Cairngorm.

    By David Tucker on Jan 17, 2008

  3. Agree, and it wont be bad if we could see something like Cairngorm, as it is from the mother-ship, gathering all good ideas from other frameworks like the listed PureMVC and others. But i think guys from Adobe Consulting know what they need to do. The sure thing is that they did great job till now and they keep jammin’.

    Adrian.

    By admin on Jan 17, 2008

  4. Cairngorm will also possibly take a slightly different form in the future. I spoke a bit with Peter Martin (from Adobe Consulting) at Adobe Max, and they have some interesting ideas for the future of Cairngorm. If they do implement changes into Cairngorm, I could see there being a split between “Adobe Consulting Cairngorm” and “Community Cairngorm”. Just a thought.

    By David Tucker on Jan 17, 2008

  5. A split that will have its roots in the split between Cairngorm and Cairngorm Enterprise that already happened. Makes sense.

    By admin on Jan 17, 2008

  6. I’d say that the difference is in the way you make use of the patterns. Each pattern has its own strengths. I started with Caringorm 1 year ago and a few months ago I tried PureMVC.

    One difference that I noticed is that Cairngorm is Enterprise-Oriented and PureMVC is UserInterface-Oriented.

    If you have an application that has a rich User Interface then the best choice is PureMVC, but if you rely a lot on a DB server and you need to make many calls to get your data from the server, then Cairngorm is the best choice.

    Currently, for the project I’m working on, which is an online video editing solution, I make use of both patterns: PureMVC and Cairngorm, but from Cairngorm I only use the ServiceLocator classes. In this case , my application has to respond to a lot of user gestures and only few calls to the server to retrieve data.

    As far as I know, PureMVC is currently developing a pattern similar with ServiceLocator. We’ll see that coming up in the future, but for now, the best thing in my opinion is to analyze very well each pattern and to compare it through the application’s features, and then decide which one is the best.

    By Dragos on Jan 17, 2008

  7. That’s right too. Cairngorm helps on large application breaking it in smaller pieces (classes), adding strength, reusability and flexibility. You don’t take much advantage of Cairngorm on small applications from the simple fact that the framework doesn’t have room to express itself. Same thing i think goes with PureMVC too although you might feel it’s usefulness sooner than with Cairngorm.

    By admin on Jan 17, 2008

  8. There ist a Breeze presentation from Ali Mills and Luke Bayes from the Slicon Valley Flex user group on the topic of “frameworks for Flex”. The outcome of their findings is quite interesting as far as Cairngorm and pureMVC are concerned. http://www.silvafug.org/ (scroll down)

    By Mart on Mar 2, 2008

  9. Interestingly, Cliff Hall of PureMVC fame is giving a presentation at Adobe HQ in London next week. You can read more at http://www.puremvc.org

    By Ben on Mar 20, 2008

  10. I completely don’t understand what is the purpose of pureMVC, trying to re-invent the wheel yet another 100th time

    By levan on Mar 28, 2008

  11. I think you’re right. Lets hope we don’t end up like in the JAVA world with lots and lots of frameworks. And i think that Adobe is aware of this by creating Cairngorm, keeping it light and if there will be a need for some more functionality be sure they will add it. Hosted by them its the best solution.

    As a side and funny note watch this video comparing Java and Ruby on Rails.
    http://youtube.com/watch?v=PQbuyKUaKFo. Funny.

    By Adrian Aioanei on Mar 30, 2008

  12. Guys, a bit of diversity is fine. It would be nice, to have a bunch of different frameworks to chose from, like in the Java world. Yes, we will then have to evaluate more and keep “up to speed”, but it will be better. Trust me :-)

    I for one do not like the “enterpriseness” and FDS bindings in Cairngorm. I do NOT need that. In my opinion, it should not be part of a framework, that architects how the UI works with the model in the view.

    It (Cairngorm) being hosted at Adobe has no real meaning. It can be hosted anywhere, as long as it has a thriving community.

    By Tech Per on May 11, 2008

Post a Comment