Filed Under (AIR, Flex, Standards) by jonr on November-17-2009

Like many Flex developers, I came to Flex development after a long stay in the Java world. For many years, Java and the surrounding community provided an exciting technical playground. Overall, the community gave developers like myself an amazing set of tools and an excellent group of thought leaders. Yet, we can look back now and realize how many silly ideas there were at the height of Java. I have long thought that Cairngorm borrows on some of my least favorite of these bad ideas, and now it looks like they are continuing down that road.

Now, they are attempting to expand from just a framework to some sort of Flex MVC framework think-tank. Yakov Fain’s reaction to this is priceless:

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

When I first saw Cairngorm (post), it was easy to understand what they were trying to do, as the framework is so heavily influenced by the original version of Struts and the Core J2EE Patterns. Unfortunately, Struts was barely a fit for the original problems it was attempting to solve, and are completely inappropriate for building client-side applications within a real runtime. Struts used an adaptation of the MVC pattern called MVC2/Model 2, which was created to deal with building user interface within request/response model. This model is completely at odds with building a rich Internet application.

So, obviously, I find the move to hold Cairngorm up as a template for architecting Flex applications a bit concerning. Beyond that, one of the other things in the Java community that never proved to bring fruit was the desire to standardize anything and everything, which this idea seems born out of.  I am actually foggy at best with what they are trying to accomplish, and find it completely bizarre that they would try and morph a framework into this “thing.”  Do we really need some sort of Flex specific think tank on a long established pattern?  Also, it seems very bold to attempt to group the work of so many others under their umbrella.

Is this just an attempt to keep the brand name relevant of a framework whose time has come and gone?

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • DZone
  • Digg
  • del.icio.us
  • Reddit
  • Facebook
  • LinkedIn

Comments:
Chris on November 18th, 2009 at 7:42 am #

Hi Jon,

My company is considering switching to Flex (from Oracle Forms… yuk), and I’m currently looking for a framework, to develop a highly customisable application (we have different features for each customer…).

I see that I’m not the only one confused by the recent Cairngorm announcement. I started looking at comparisons between Cairngorm, PureMVC, Mate, Swiz… and would like your take on these different frameworks (obviously, you don’t like Cairngorm…).

I need something not too complicated, so that Forms developers don’t immediately reject the new technology (Mate seems fairly simple).

Thanks,

Chris.

cease on November 18th, 2009 at 12:36 pm #

“MVC2/Model 2, which was created to deal with building user interface within request/response model. This model is completely at odds with building a rich Internet application.” Rather than spending the blogpost complaining about how bad it is, you should of listed whats wrong, and why its wrong in your opinion. I do agree with your points, after working with both Cairngorm, but I instead went with PureMVC, which I feel like you would probably make the same arguments of silly design patterns, and over architected (at least this is what I feel are your major arguments for cairngorm).

Bucky Schwarz on November 18th, 2009 at 1:16 pm #

@Chris

I used to work at a company that used Oracle Forms and migrated to Flex 2/3. Over there, Cairngorm was pretty much universally disliked.

We tried PureMVC on a project and it was easier than Cairngorm, but it was still a bit roundabout and complicated for doing simple tasks. Check out this link for a discussion on Flex frameworks.

http://www.adobe.com/devnet/flex/articles/flex_framework_02.html

Allen R. on November 18th, 2009 at 1:26 pm #

I share the same sediment, in fact, I was the lone voice at my current employer advocating NOT using a micro-framework, a debate I lost. Flex’s event architecture coupled with the power of ActionScript (if you’re willing to use it, and not write it like it’s Java, i.e. embrace closures) and a few conventions will allow for the creation of clean, usable code. Mate, Swiz, PureMVC, Cairngorm, SpringAS, etc, they’re all trying to bring answers to Java’s hurdles into Flex. A previous comment asks “what’s wrong with it?” I’ll give one example. Flex’s data binding is not the end all, there are plenty of instances where code in your UI needs to have a hookpoint after an asynchronous response is received. Most people use Cairngorm’s “view locator” to interface into the view from the command, but at that point, you’ve lost all that the commands supposedly buy you. I find myself constantly working around the framework, a prediction I made before we started using it.

Huge Balls on November 18th, 2009 at 1:58 pm #

What you have to remember is that Cairngorm has always blown goats.

It was created by IterationTwo and hyped as the best thing ever for Flex development. At the time there was no other Flex frameworks to compare it to so it ‘won’ by default.

What they always failed to mention was that it was actually the best for their own bottom line because it gave their company tons of ‘credibility’ and lead to them being bought out.

They are now ‘Adobe Consulting’.

Cairngorm is the worst framework for Flex development and I highly recommend not using it.

It will turn a light weight, modular, and clean application into a gigantic non-modular piece of crap that takes long to write and is hard to maintain.

That and it will multiply the number of files and the size of your application by ~8x.

jonr on November 18th, 2009 at 2:42 pm #

Hi Chris,
It’s good to hear about more Flex adoption.

On my current project we are using Mate. It’s ok, but I don’t think I would use it again. I just don’t think it does enough for the extra overhead it imposes. It also seem better suited to smaller applications with simpler flows. When we selected Mate, I did an in-depth evaluation on Swiz and like they way it approaches things. We went with Mate over it because we had team members with previous experience working with it. The Parsley framework has been all the rage lately: http://www.spicefactory.org/parsley/. I haven’t looked at it yet, but it’s next on my list to checkout.

Good Luck.
-Jon

jonr on November 18th, 2009 at 2:46 pm #

Hi Cease,
In some of my older posts, I went into more detail on the issues I see in Cairngorm. In this post, I was trying to give a high level summary to set the context for my thoughts about the recent Cairngorm news. You can find my older post here:
http://gorillajawn.com/wordpress/2007/05/29/cairngorm-framework-%E2%80%93-a-few-suggestions/
http://gorillajawn.com/wordpress/2007/05/21/cairngorm-%E2%80%93-flex-application-framework-my-initial-reactions/
Thanks for the comment,
Jon

jonr on November 18th, 2009 at 2:50 pm #

Bucky,
Thanks for your comment. I think you summarize a common experience with Cairngorm and PureMVC well. I think it’s worth noting that Flex is very powerful on it’s own, and there not always a good reason to drag in an MVC framework (i.e. one can easily do MVC in Flex without any additional framework).
Thanks,
Jon

jonr on November 18th, 2009 at 2:50 pm #

Thanks for the comment Allen. I completely agree!

Ryan K on November 18th, 2009 at 5:27 pm #

We are using swiz on are current project and really liking it. http://code.google.com/p/swizframework/

It is very lightweight and unobtrusive. With all the bad reviews on cairngorm why doesn’t Adobe take a hint a drop it? If Flex developers are ever forced into using a cairngorm I would rather go back to using plain HTML.

Darren on November 18th, 2009 at 5:40 pm #

Parsley seems to be coming along very well and the lead developer Jens seems very responsive in the Parsley forums.

RobotLegs is another framework which is built on solid OOP principles and is almost at 1.0:

http://shaun.boyblack.co.za/blog/2009/10/07/robotlegs-as3-v0-9-elasticchaos-broken-fixed-tidied-improved/

Chris on November 19th, 2009 at 2:54 am #

Thanks to all for the input, although I’m a little bummed that Jon has decided not to use Mate again (it was my favorite “on paper”). The following two comparisons favor it, but they’re probably already outdated…:
http://www.insideria.com/2008/12/frameworkquest-2008-introducti.html
http://stackoverflow.com/questions/37043/flex-mvc-frameworks

I’m turned on by the apparent simplicity, especially compared to Cairngorm and PureMVC. Also, it seems that if I chose Mate and realized I’d made a mistake, it would be easier to switch because of the absence of framework code in the views, business logic, and server access.

But I will now check out the links you guys have posted.

Mario Arias on November 19th, 2009 at 5:39 pm #

Hi

I’m new to Flex development, but I have a strong background in Java (Spring, Struts, Stripes) and Action Based MVC frameworks

I think that impose a “Action Based MVC” framework in a RIA is a big error, must if is based on Struts.

Is necessary to understand that “Action Based MVC” are a great help (at least in the case of Stripes, Struts is a pain in the …) in a Request/Response scenario. But In a RIA scenario is shooting your self in the foot.

At this point I think that Flex is very competent presentation technology and you don’t need and extra layer of complexity. With a good knowledge of OOP, you’ll produce correct applications in Flex in no time.

The two things that I miss are the language: ActionScript is a nice language (and IntelliJ helps a lot), but some things are a bit odd; and a IoC container (Maybe I’ll pick Spring AS)

Jack on November 20th, 2009 at 1:55 pm #

Another happy swiz user here. You can use it as much or as little as you want. Many conveniences, like being able to listen for an event anywhere in any class or mxml within the app.

Niko on November 23rd, 2009 at 4:33 am #

I think opinions like this from seasoned Java guys should be required reading for anyone who has come to Flash from elsewhere, like a design background (myself included). The worst are the people who have come to Flash a looong time ago, seen it grow, and learned programming with Flash (myself included), and then get all excited about adding more and more architecture to Flash. I’m lucky to work with people who have been through this on Java, so they’re there to hit me on the head if I start to get tempted by shiny frameworks…

Alberto on December 23rd, 2009 at 10:40 am #

I agree with you jonr. Model2 /MVC pattern was an improvement over model 1 development with jsp, asp but has nothing to do now a days in a Flash client.

My expirience with model 2 frameworks in Java is huge i have developed with and tested a lot of them and what i can say is that kind of frameworks are very prone to errors because for building a simple page you have to touch and configure too many things.

Flex framework is clean enought to allow everybody build understandable applications.

Post a comment
Name: 
Email: 
URL: 
Comments: