Developing Flex RIAs with Cairngorm microarchitecture
What is Cairngorm?
Cairngorm is fundamentally a methodology for breaking up your
application code by logical functions; by data, by user views, and by the code that
controls everything. This is routinely referred to as MVC.
The Pieces of Cairngorm
· Model Locator: Stores all of your application’s Value Objects (data) and
shared variables, in one place. Similar to an HTTP Session object, except that
its stored client side in the Flex interface instead of server side within a
middle tier application server.
· View: One or more Flex components (button, panel, combo box, Tile, etc)
bundled together as a named unit, bound to data in the Model Locator, and
generating custom Cairngorm Events based on user interaction (clicks,
· Front Controller: Receives Cairngorm Events and maps them to Cairngorm
· Command: Handles business logic, calls Cairngorm Delegates and/or other
Commands, and updates the Value Objects and variables stored in the Model
· Delegate: Created by a Command, they instantiate remote procedure calls
(HTTP, Web Services, etc) and hand the results back to that Command.
· Service: Defines the remote procedure calls (HTTP, Web Services, etc) to
connect to remote data stores.
Fit All the Pieces Together
Your client interface is comprised of Views. The Views use Flex binding to display data contained in the Model Locator.
The Views generate Events based on user gestures such as mouse click, button press, and drag & drop.
Those Events are “broadcast” and “heard” by the Front Controller, which is a map of Events to Commands.
Commands contain business logic, create Delegates to perform work, handle responses from Delegates,
and update the data stored in the Model Locator. Since Views are bound to the data in the Model Locator the Views
automatically update when the Model Locator data is changed.
Delegates call Services and hand results back to Commands, and are optional but recommended.
Services make remote data calls and hand the results back to Delegates.
Read more :
1. good article, explains how to build Flex Application with Cairngorm micro architecture :
The presentation demonstrates a real life example Cairngorm Store which includes J2EE container and Flex Data Services/ Java.
If you still want to run this application but without the J2EE container part (Mockup data),
Check the ntier.wordpress.com/modcairngormstore/ example