Cairngorm Diagram Explorer update

This post was written by jimrobson on February 18, 2009
Posted Under: Cairngorm, Flex

I was delivering Cairngorm training to a client’s development team, and the team lead mentioned that the old Cairngorm Diagram Explorer really helped him get a feel for how the various moving parts of Cairngorm work together. After browsing through it, everyone on the team agreed that it was a great tool, but that since it was out-of-date (based on Cairngorm 2.0/Flex 2) it could be confusing to new developers. So I decided to bring it up to Cairngorm 2.2/Flex 3, following the best practices outlined in the Cairngorm training materials.

You can click here to view the Explorer and interact with it, or click here to download the zip that includes the Explorer and the Flex application on which it is based.

Let me know if you run into any issues or if you see room for improvement.

Reader Comments

I loved the explorer! It helped me get my CG start and I used it several times to help other devs wrap their brains around CG. When I tried learning PureMVC I was lamenting it’s lack of a clear interactive process diagram!

Great Job!

#1 
Written By John Wilker on February 18th, 2009 @ 7:12 pm

@John - you gave me an idea! I will build an interactive version of the PureMVC diagram. Thanks!

#2 
Written By jimrobson on February 19th, 2009 @ 3:33 pm

Thanks for sharing: it is really useful for me (flex newbie ;))

#3 
Written By Mario Scalas on May 10th, 2009 @ 2:44 pm

@Mario,

I’m glad you find it helpful!

#4 
Written By jimrobson on May 10th, 2009 @ 10:58 pm

Getting into Cairngorm the diagram helps me a lot - all i need in just one window - thx a lot

#5 
Written By Beatrix Kr├╝mmer-Frau on May 14th, 2009 @ 10:27 am

In the example, there is a delegate for the action “add contact” and also a service for this action.

I am not sure is a good practice to have 1 service + 1 delegate for every action. Most of the time, we use only 1 service (RemoteObject, HTTP…) to access to a server controller which executes and returns the right stuff.

#6 
Written By Tom on May 15th, 2009 @ 7:38 am

@Tom -

You raise a good point. Cairngorm does not specify a ratio of delegates to services, and there are multiple ways of approaching this. Some developers have each delegate handle all of the actions for a given object type. So in the example, a real-world delegate might handle all creates, reads, updates, and deletes for Contact object types. You then might have one service for Contacts that serves all of these actions. There are a couple of important points to keep in mind:
1) Make sure that the service requests don’t collide. For example, if you have one HTTPService object for multiple actions, and you use the syntax httpSericeInstance.addEventListener(ResultEvent.RESULT) then you can end up having the wrong callback invoked, which will produce undesirable results.
2) On the other hand, try to avoid excessive repetition in your code.

In the sample application, there is only one action, so it makes sense to have one delegate and one RemoteObject instance. In non-trivial applications, you need to make design decisions based on your specific requirements, development team, etc. Thanks for posting your thoughts!

@Beatrix -

Glad you found it helpful!

#7 
Written By jimrobson on May 15th, 2009 @ 2:06 pm

I use cairngorm for while! With Coldfusion or with Php as backend. All the time, I have got exactly the same structure in my backend: MVC MVC MVC!

So,I have extended the Cairngorm controller in order to dispatch my Flex event to the server (or to the classic ICommand)! I use only 1 delegate of the same service, and I have also a BackController which executes the right server command and returns the result AMF encoded.

Its just so seamless now! CairngormEvent are directly dispatched on my server and returns to the Flex command.

I am doing a little post about it… keep u posted

#8 
Written By Tom on May 15th, 2009 @ 5:48 pm

The Cairngorm Explorer is quite useful and the interactivity employs a good method for training on all types of other subjects. So, I’m interested in the Explorer itself. Can you explain the techniques used to build the Explorer? SVG? Degrafa? Is there any source code available for the Explorer? I am often explaining other types of models that could benefit from a [insert model name here] Explorer!

#9 
Written By Don Adkins on July 17th, 2009 @ 1:06 am

Don -

The explorer is simply a Flash application, originally built by Evan Gifford and posted on the Cairngorm Docs website here: http://cairngormdocs.org/blog/?p=18

#10 
Written By jimrobson on July 18th, 2009 @ 8:41 pm

Trackbacks