Cairngorm (Flex Framework) - Model View Controller Based Architecture

Model View Controller Based Architecture

Cairngorm is based on the MVC model. It is specifically designed to facilitate complex state and data synchronization between the client and the server, while keeping the programming of the View layer detached from the data implementation.

The role of the View layer in a Cairngorm application is to throw events and bind to data stored in the Model. Components on the View can bind to Value Objects or other properties in the Model (data) layer.

In a Cairngorm Model, related data are stored in Value Objects (VOs), while simple variables can be stored as direct properties of the ModelLocator class. A static reference to the ModelLocator singleton instance is used by the View layers to locate the required data.

The Controller is the most sophisticated part of the Cairngorm architecture. The Controller layer is implemented as a singleton FrontController. The FrontController instance, which receives every View-generated event, dispatches the events to the assigned Command class based on the event's declared type.


The Command class then processes the event by running the Command class' execute method, which is an ICommand interface method. The event object may include additional data if required by the developer. The execute method can update the central Model, as well as invoke a Service class which typically involves communication with a remote server. The IResponder interface, which is also implemented by the Command class, includes onResult and onFault methods to handle responses returned from the invoked remote service.

Read more about this topic:  Cairngorm (Flex Framework)

Famous quotes containing the words model, view, based and/or architecture:

    The striking point about our model family is not simply the compete-compete, consume-consume style of life it urges us to follow.... The striking point, in the face of all the propaganda, is how few Americans actually live this way.
    Louise Kapp Howe (b. 1934)

    That author who draws a character, even though to common view incongruous in its parts, as the flying-squirrel, and, at different periods, as much at variance with itself as the caterpillar is with the butterfly into which it changes, may yet, in so doing, be not false but faithful to facts.
    Herman Melville (1819–1891)

    Any reductionist program has to be based on an analysis of what is to be reduced. If the analysis leaves something out, the problem will be falsely posed.
    Thomas Nagel (b. 1938)

    The two elements the traveler first captures in the big city are extrahuman architecture and furious rhythm. Geometry and anguish. At first glance, the rhythm may be confused with gaiety, but when you look more closely at the mechanism of social life and the painful slavery of both men and machines, you see that it is nothing but a kind of typical, empty anguish that makes even crime and gangs forgivable means of escape.
    Federico García Lorca (1898–1936)