The architectural framework Cairngorm was created by Alistair McLeod and Steven Webster while they were working at the company iteration::two they are presently employed by Adobe Consulting. It was open sourced in the summer of Cairngorm was designed to ensure that UI components do not need to know where data is located. The business layer retrieves data from the servers and stores it in the memory objects that represent the data model, which use binding to notify the UI components about data arrival or changes.
|Published (Last):||12 May 2012|
|PDF File Size:||20.92 Mb|
|ePub File Size:||6.61 Mb|
|Price:||Free* [*Free Regsitration Required]|
Each view is defined in its own mxml file in the "uk. Notice how the selectedIndex property of the ViewStack is bound to the. This means that the currently selected view may be changed by changing the model.
So now let's drill down into the InitialView component. We can then see the details of what is presented to the user, and what happens when the user responds to that interface. InitialView is itself an mxml component based upon the standard VBox component.
It contains some script and some UI components. Firstly, the script contains a bindable reference to the AppModelLocator singleton. Below this text component there is a button "translate". Clicking this button calls an actionscript method in the script on the page. The method is called translate. It could at that point do some validation, or request further input. However, in this case all that we want it to do is fire of a request for the text "Hello everyone" to be translated.
The least impressive Flex app ever. The DataChangeEvent is defined in the "uk. It is a cairngorm event extended to carry our message. We can create events that can carry whatever data we need to be passed to a command. For example, a user types their username and password into a login box, this is then wrapped in a LoginEvent, and the event dispatched. A LoginCommand receieves the event and attempts a login using a LoginDelegate and login service. If succesful, the command changes the current view to one appropriate to a signed in user.
The next step is to dispatch that event and its message to the Cairngorm controller. This should then get passed on to the required "command" object the command object contains the code for executing the requested command. But how does the controller know which command object to use? Events are mapped on to commands in the control.
This is where we do the work that results in the translation. In this simple example, the. However, we could instead refer to an English-Steswana dictionary to retrieve the translation.
This might even require the use of an external data service. The DataChangeCommand would then delegate the work of sending this external request to a Delegate class in the "business" folder. The delegate, on retrieving the required translation, calls back to the DataChangeCommand to complete the requried command, or alternatively calls a seperate command. So, with the text control on the current view bound to the. But what if we also need to change the current view, for example to the AlternativeView control in the ViewStack?
The command simply alters the. As the selectedIndex property of the ViewStack is bound to. Look - it speaks Setswana! Transversality - Robert O'Toole. The app doesn't do much, initially displaying "hello everyone", along with a button that translates that message, and a second button that changes the background colour of the component.
Exciting stuff! But the Cairngorm framework is. Download the source code for my demo application. Read the full article Explanation Here is a screenshot of the Navigator window for the project: The Cairngorm source code is included in the "com" folder although it could be compiled and included as an external library. The "uk. This has six subfolders, each containing classes responsible for different parts of the MVC architecture: view, control, command, business actually meaning data and comms services , model, vo value object.
As with all Flex applications, there is a single container mxml file, called Main. I'll start my explanation of this app and Cairngorm with this top-level container. The Main. Conclusion This may be a simple example, but I can already see how using the Cairngorm framework will simplify the task of building very complex applications, resulting in better, more rational and sustainable code.
No comments. Add a comment You are not allowed to comment on this entry as it has restricted commenting permissions. Search this blog.
List of Flex frameworks
In recent years, the Flex technology has been widely used. Adobe Flex application framework designed to start introduction of the Cairngorm framework. The framework with the MVC design pattern to simplify the application development model, specification of the application development process, and pay more attention to the business logic, the author after careful study of the entire framework, the control layer of the Cairngorm framework is made some improvements to the improved version of the Cairngorm framework. The improved version of the Cairngorm framework is more suitable for Web application development and maintenance. Request Permissions. Rich Internet Application White Paper. Adobe Flex Master Lu.
Cairngorm Framework for Flex Developers
A collaboration of recognized design patterns, Cairngorm exemplifies and encourages best-practices for RIA development advocated by Adobe Consulting, encourages best-practice leverage of the underlying Flex framework, while making it easier for medium to large teams of software engineers deliver medium to large scale, mission-critical Rich Internet Applications. Cairngorm follows the principle of separating the view and business logic which is known as the Model-View-Controller pattern MVC. The following list shows the different elements that form the framework. View : Contains UI controls for user interaction and displays the state of the models data. Views dispatch events handled by the controller. Model Locator : It acts as a centralized repository for all data needed in the application. It manages the view an is declared as [Bindable] to use all variables for data binding in the view.
Invoke SAP web services with flex using Cairngorm framework
The best way to get started with Cairngorm depends on your own background. Are you a new comer, an old timer or a visitor? Named after a mountain range in the eastern Highlands of Scotland, Cairngorm is a resource provided by the Adobe Technical Services Organisation to developers and technical architects to deliver successful Flex projects in the enterprise. Cairngorm is pronounced kern-grm and you can hear it said with an American accent here or in more authentic Scots here.
Getting Started With Cairngorm 3
Each view is defined in its own mxml file in the "uk. Notice how the selectedIndex property of the ViewStack is bound to the. This means that the currently selected view may be changed by changing the model. So now let's drill down into the InitialView component. We can then see the details of what is presented to the user, and what happens when the user responds to that interface. InitialView is itself an mxml component based upon the standard VBox component. It contains some script and some UI components.