| Jon Rose’s Blog | | Enterprise Software Consultant Open Source / Java / Flex Flex Practice Director @ Gorilla Logic, Inc. InfoQ.com RIA Editor |
![]() |
Comments:
Stefan Schmalhaus on May 21st, 2007 at 2:08 am #
You may want to read the very interesting discussion of MVC/Cairngorm on Sho Kuwamoto’s blog:
Mark on May 21st, 2007 at 4:47 am #
Interesting Analysis… Though you can access Databases more or less using Flex Data Services (now known as LiveCycle DataServices). I am no expert, but I found the Commands to be great at encapsulating ALL of the code that affects the model away from the View or Delegate. I think the delegates are good to be kept seperate from the Commands to allow for unit testing, also, it means that 99% of the code is handled in the command… which is immensely useful in debugging a complex application.
Jon on May 21st, 2007 at 6:14 am #
Jon, Great write-up on Cairngorm. I’ve also wondered about a few of your points, but you definitely raised some new questions for me. Do you think that Cairngorm could be improved to better leverage the client-server model for a more “natural” SoC? I would really like to see a response from a Cairngorm “expert” or someone on the development team. It’s always beneficial to see multiple perspectives.
James Ward on May 21st, 2007 at 6:39 am #
Hey Jon, I’m glad you are looking at Cairngorm. I’m working on an article about MVC in Flex. Sometimes Cairngorm is overkill. For simple applications with a single developer you can just use the Service Locator, Model Locator, Delegate, and Value Object patterns. But I think in most non-trivial Flex applications those are a minimum. If you are just using those patterns Cairngorm probably isn’t necessary but it might be helpful if you plan to someday be using Cairngorm in your app. Anyways, this is a great write-up! Thanks! -James
James Ward on May 21st, 2007 at 6:52 am #
I forgot to say… This blog helps me to know what to focus on in the article I’m writing. need… coffee…… too… early…
jonr on May 21st, 2007 at 9:06 am #
Thanks for the comment Mark.
justin on May 21st, 2007 at 10:24 am #
I couldn’t agree more. I ended up rolling one consisting of view, controller, dataManager (service and data tranformation in one), session (modelLocator + transient session data)
JesterXL on May 21st, 2007 at 11:23 am #
I come from a Flash / designer background, so here are my responses. 1. why do I need this level of abstraction when there is a natural SoC in the client-server like programming model of Flex? Delegates are invaluable when your backend is: For A, if the API changes, the rest of my app gets the same data, I only have to change 1 class per call. For B, if I’m not using Remoting, I have to parse data and make ValueObjects out of it. The Delegate handles all this mess with Factories. Again, the rest of my app gets the same data, no matter what the data is (XML, URL encoded vars, etc.). Commands are then allowed to focus on just data handling, typically the core of the app. Since the Views are bound to that data, this heavy lifting code is not polluted with data parsing. I can see later you dig Business Delegates too. You must understand, though, Commands can get VERY hairy since you are doing the most important updateing and changing of data. Keeping these classes simple and short makes your most important code easy to read, upodate, and maintain. 2. why introduce a Front Controller into an event programming model like Flex? Agreed. To me, it’s just a formality. There ARE people who build wrappers around this that address the concerns you talk about, hence Cairngorm v2.2 having the ability to use weak listeners as well as removing commands programmatically. I still feel it’s a leftover to make Java devs comfortable.
ablesa on May 21st, 2007 at 3:02 pm #
Hey Jon, interesting point of view…
Bjorn on May 21st, 2007 at 5:01 pm #
I’m a fan of using Delegates with Remoting. Some areas of Cairngorm initally seemed overkill to me as well until I was assimilated and accepted that it is an industry standard framework and hopefully new developers coming into my project will find it easier to grasp because of their familiarity with Cairngorm. I am always interested to read and try alternatives
Damien Jorgensen - Wales on July 7th, 2007 at 1:09 am #
I am just startig in Flex, interesting topics raised here
Tanuvan on August 3rd, 2007 at 11:21 pm #
Overkill!!! Perhaps to pacify the Java fans. The Cairngorm just seems way to much for being practical. Value Objects are ok. It seems to me that Flex2 is naturally event driven, but some of these frameworks seem to complicate even the simplest of things.
Jon Rose’s Blog » Blog Archive » Mate :: Flex Framework on November 22nd, 2008 at 4:02 pm #
[...] have been rebelling against dragging additional frameworks into Flex just for MVC for a while now (Flex and MVC / Cairngorm). I finally got a chance to spend some time coding with Mate on a flight back from [...]
Jon Rose’s Blog » Blog Archive » Flight Framework for Flex & What is so great about MVC? on March 8th, 2009 at 11:56 pm #
[...] consider using Flight, as I still don’t understand what value Cairngorm provides (old post 1 & 2). That doesn’t mean I don’t believe that Flight may have value, but in [...]
Jon Rose’s Blog » Blog Archive » Cairngorm: All the worst parts of Java on November 17th, 2009 at 11:59 pm #
[...] I first saw Cairngorm (post), it was easy to understand what they were trying to do, as the framework is so heavily influenced [...] Post a comment
|
|