Datasheet
Chapter 1: Introducing Cairngorm
7
ModelLocator
The ModelLocator serves as a central repository for shared application data. It allows components of the
application to have access to the same set of data to ensure synchronization. Additionally, through Flex ’ s
data binding mechanism, it notifies views of any changes to the data so that the views can update
themselves to reflect those changes.
ServiceLocator
Most RIA applications require communication with a backend system. This communication with the
backend is generally accomplished with one of the remoting classes, such as HTTPService, WebService,
or RemoteObject. The ServiceLocator provides a centralized location for access and sharing such services
so that they do not have to be declared in each component that needs to access the service.
Commands
Command classes are triggered by Cairngorm event classes to trigger business logic and update the
ModelLocator. In standard Cairngorm practice only a command should ever update the ModelLocator.
Events
Event classes are used to trigger command classes and pass along any data they require.
FrontController
The FrontController provides a centralized location for defining how Cairngorm events are handled.
This class registers event - command relationships and triggers the registered command for a given event
when that event is fired.
Value Objects
Value objects are classes that represent conceptually related sets of data. Value objects contain public
properties that represent the individual pieces of data being represented. They are commonly used to
represent data in views by binding to their properties, and to transfer related sets of data between classes
in the application and the server.
Delegates
Delegates are classes responsible for accessing remote services. They serve as proxy objects that take care of
the details of accessing a particular service and return the data from the service via responder functions.
Basic Cairngorm Logic Flow
Now that you have a sense of the major components that make up Cairngorm, the following is a broad
overview of how logic is implemented in a Cairngorm application.
The basic chain of events in a Cairngorm application can be seen in Figure 1 - 1.
c01.indd 7c01.indd 7 10/20/09 12:26:41 PM10/20/09 12:26:41 PM