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:

    Your home is regarded as a model home, your life as a model life. But all this splendor, and you along with it ... it’s just as though it were built upon a shifting quagmire. A moment may come, a word can be spoken, and both you and all this splendor will collapse.
    Henrik Ibsen (1828–1906)

    One might feel that, at my age, I should look on life with more gravity. After all, I’ve been privileged to listen, firsthand, to some of the most profound thinkers of my day ... who were all beset by gloom over the condition the world had gotten into. Then why can’t I view it with anything but amusement?
    Anita Loos (1894–1981)

    Both magic and religion are based strictly on mythological tradition, and they also both exist in the atmosphere of the miraculous, in a constant revelation of their wonder-working power. They both are surrounded by taboos and observances which mark off their acts from those of the profane world.
    Bronislaw Malinowski (1884–1942)

    Polarized light showed the secret architecture of bodies; and when the second-sight of the mind is opened, now one color or form or gesture, and now another, has a pungency, as if a more interior ray had been emitted, disclosing its deep holdings in the frame of things.
    Ralph Waldo Emerson (1803–1882)