Search Flex Components Free

Custom Search

December 27, 2007

Cairngorm (Flex framework) in Flex

Cairngorm is one of the primary open source frameworks for application architecture in Flex. Cairngorm is based on the MVC Model . In complex computer applications that present a large amount of data to the user, a developer often wishes to separate data (model) and user interface(UI-view) concerns, so that changes to the user interface will not affect data handling, and that the data can be reorganized without changing the user interface. The model-view-controller solves this problem by decoupling data access and business logic from data presentation and user interaction , by introducing an intermediate component: the controller .

  • Model : The domain-specific representation of the information on which the application operates. Domain logic adds meaning to raw data (e.g., calculating if today is the user's birthday, or the totals, taxes and shipping charges for shopping cart items). Many applications use a persistent storage mechanism (such as a database) to store data. MVC does not specifically mention the data access layer because it is understood to be underneath or encapsulated by the Model.
  • View : Renders the model into a form suitable for interaction, typically a UI element. Multiple views can exist for a single model for different purposes.
  • Controller : Processes and responds to events, typically user actions, and may invoke changes on the model.

How Flex fits the MVC models??

The goal of the Model-View-Controller (MVC) architecture is that by creating components with a well-defined and limited scope in your application, you increase the reusability of the components and improve the maintainability of the overall system .Using the MVC architecture, you can partition your system into three categories of components:

  • Model components : Encapsulates data and behaviors related to the data.
  • View components : Defines your application's user interface.
  • Controller components : Handles the data interconnectivity in your application.

For example , with the MVC design, you could implement a data-entry form that has three distinct pieces:

  • The model consists of XML data files or the remote data service calls to hold the form data.
  • The view is the presentation of any data and display of all user interface elements.
  • The controller holds the user interface logic.

Although you can consider a Flex application as part of the View in a distributed MVC architecture, you can use Flex to implement the entire MVC architecture on the client. A Flex application has its own view components that define the user interface, model components to represent data, and controller components responsible for the communication with back-end systems. This client-side separation of task is not available in HTML.

Related Flex Tutorials