How the Flex Framework Cairngorm 2 Died

When a new version of a software is released, the old version lives for a while and its creators usually care about supporting it. Yesterday, after reading about the release of Cairngorm 3, it’s clear that Adobe Consulting ignores this rule.

For those who are not following Cairngorm evolution, I want to remind that there was a framework called Cairngorm 2, that was a library of classes (built on Model-View-Controller architecture) to be included in the Flex application. I never agreed with the architecture of Cairngorm 2 which was acting as a Crazy Glue and lead to generation of monolithic applications based on global singletons. People who follow my writings or were attending my presentations at various conferences know that during the last four years I was openly stating that Cairngorm 2 has more cons than pros. For example, here’s the just one of of these occasions – a video of the panel on enterprise frameworks at Adobe MAX 2008 (after this blog, I doubt that I’ll ever be approved as a MAX speaker again).

Now, when I looked at the design of a product that’s now branded as Cairngorm 3, it’s clear that Adobe assigned to this project the right engineers (i.e. Alex Uhlmann) and there is hope that this methodology (it’s not an MVC framework any longer) may produce or include useful component libraries.

My first problem is that the Cairngorm 2 has literally disappeared from the face of Earth (the only trace found is the site cairngormdocs.org that has some old documentation).

My second, and more serious problem is that Adobe Consulting up till today has never made a statement that selecting Cairngorm 2 was a wrong path. There are lots of enterprises that some time ago started using Cairngorm 2 (recommendation by Adobe Consulting) just to find themselves with a large monolithic application at hand that took long to download and was difficult to modularize.

A couple of years ago, I lead a large enterprise project for a customer that I won’t name, but will provide some relevant technical details. When I joined, the team was already 5 months into the project. This consumer facing application was producing one 5Mb SWF file. Just recompiling the application in Flex Builder was a lengthy project. I started to look at ways of modularizing this application so the first screen would come up sooner than 90 seconds for customers sitting on DSL connections.

Sure enough, the project has been built with Cairngorm 2 by advise of some engineer from Adobe Consulting (not to be confused with Adobe Flex team). The Cairngorm’s global class FrontController is expected to be a registry for all possible events that travel through the system let alone tons of classes and boilerplate code written just to support that life cycle of the framework itself.

My first suggestion was to start modularization with removing Cairngorm. They asked, “How much?” It would take two man-weeks worth of work, but they didn’t have time for this. To make the long story short, we had to modularize the application in a non-kosher way – the main SWF had a knowledge about all events in every module. Changes in a module’s code can lead to changes in the main applications. Tight coupling in action.

I’m sure there are lots of enterprise teams that were similarly misguided and were marching in a wrong direction under the Cairngorm 2 banner.

With the release of Cairngorm 3, the Cairngorm 2 has vanished. I’m sure, if you’ll hire a private eye, you’ll find its code (has not been updated from about three years) in some SVN repository. But this is not how the new version of the enterprise software should be released.
I’d like Adobe Consulting to state loud and clear, “If your team started development of a large enterprise project with Cairngorm 2, please stop. This was our mistake, and the sooner you switch to Cairngorm 3 or any other lighter framework the better.”

Will it happen? Let’s wait and see.

Yakov Fain
P.S. The views and opinions expressed in this blog are purely my own and don’t represent views of my employer

I’m Cairngorm!



First, let me ask Java developers a question. Imagine that one day you wake up and read the following announcement, “As of today, Spring framework is the foundation for delivering of successful J2EE projects. In contrast to earlier versions, many parts apply across frameworks. So, if you are using Struts, JSF, and especially Tapestry, just forget about all these complex to pronounce names. From now on, no matter what framework you use, you are actually using Spring’.

Some of you would think, “Yakov is either out of his mind or is writing this blog sitting in one of the coffeshops in Amsterdam”. Wrong! I’m just reading an announcement about the upcoming release of the popular Adobe framework Cairngorm 3: http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm+3

Based on this announcement, even if you are using PureMVC, Swiz, Mate, or whatever else will be invented in the future, you are using Caingorm. Basically, instead of addressing issues of the Cairngorm 2 framework, someone decided to reuse a well recognized brand in rather small Flex community (about 250K developers) and turn it into a set of guidelines.

The Getting Started document reads, “The original Cairngorm library remains a part of Cairngorm 3, but has not been updated for this release.” Two paragraphs down it states, “To migrate from Cairngorm 2 to 3, you should first read the Cairngorm Guidelines to understand how your existing client-side architecture might be improved. This could involve introducing an inversion-of-control container or simply refining the way you use the original Cairngorm library.”

Now I’m confused. If Cairngorm 2 was a framework and Cairngorm 3 is not, what this improvement from 2 to 3 means? Introduction of IoC simply means throwing away Cairngorm 2 in favor of Parsley, Swiz or Mate. Am I missing something?
Cairngorm 3 includes the following libraries: Observer, Popup, Task, Validation, Integration, Module, Navigation.  Several of them “are implemented as extensions of Parsley Application Framework. In order to take advantage of these libraries, you also need to use Parsley”. Wait a minute. Do I need to use both Cairngorm and Parsely on top of Flex framework? If before, you should’ve added to the project one swc of the selected framework, now you’ll need to add a bunch of them. Are we going to build a pyramid of frameworks or something?
Cairngorm tools include Flex Builder (I assume Flash Builder too), Cairngorm 2, FlexCover, FlexPMD, Flex-Mojo for Maven… What if they decide to use our open source ANT script generator Fx2Ant and include it in Cairngorm too? Is this a good thing?

Yesterday, I’ve attended an interesting presentation about disruptive thinking, where presenter kept asking, “What if you could fly?” Applying the same technique, I’m asking myself,  “What if I’m Cairngorm?”

Tried it several times. It doesn’t work so far. Sure, I’ve gained some weight, but it’s too soon to call myself a mountain. But I’ll be there! I can do it! We need a change! For now, I’ll just use this word as my middle name:

Yakov Cairngorm Fain.

Sounds good, isn’t it?