Flex:: Introduction to Cairngorm
Cairngorm, a really nifty Flex framework that I use quite often at work, with my company, and therefore would give my highest recommendations for it to be the enterprise-framework of choice for Flex developers. Adobe identifies Cairngorm as a micro-architecture that addresses key issues through best-practices in the areas of (1) handling user events in the front-most layer, (2) arranging and managing business logic elegantly, and (3) consistently managing state on the client-side. That is, unlike traditional web-development situations, RIA and Flex in particular is more stateful. [ad] 1. Value Objects Part of keeping the promise of having a stateful application, Cairngorm has borrowed a concept from J2EE, Value Objects or Transfer Objects, which are passed across various layers of our application, in a decoupled way. The following is an example of what a VO looks like :class com.doronkatz..application.vo.CarVO
implements ValueObject, Comparable
{
public static var registered:Boolean =
Object.registerClass( "com.doronkatz.application.car.
vo.CarVO", CarVO );
public var id : Number;
public var make : String;
public var model : String;
public var year : Date;
}
The value object is connected through to the front-layer UI through a concept called data-binding leaving objects to act as source and destination, so if changes are made on one side, it is updated for the other side (i.e updating a text box updates the value through live binding). This is more commonly evident when we play around with Data Grids. The diagram below put's the VO and binding in context. We will explain the rest of the diagram, bit-by-bit.
[ad#Adsense]

This is it for the first introduction. I will go into each of the components with code samples in the next article.


Leave a comment...