Wednesday, December 10, 2008

Cairngorm Phew!!!

Cairngorm was always a slippery eel. You hold one class the other slips through your hands. But thanks to David Tucker & other bloggers it enabled me to put together an example which one may relish. Probably it may be just another example but you know what my exp. says the more examples you browse:

1. You get better in reading code.
2. You get a different perspective.
3. Nobody can say you ripped in out from this blog..just joking..

Lets start with few basics. I know this ya da da da is there every where but its important you know.. My post must be long you see... So here goes my version..

First thing none of these bifurcations are strict you could implement every thing in one page or break it into tiny pieces.. Why? since the whole community is reading it like that nah it makes sense on a long run.

You must have  a Main.mxml which is going to house all other elements of this jig saw puzzle. 

modelLocator will hold the variables which area going to be common across modules and which has to be accessed in the command section. we'll see that later.

view: this will hold the view section or the so called front end of the flex application

vo(value object): some thing like a bean we use in java while send data to the event to the command. I am coming to that ..

Front controller: the supervisor.. He says which event is linked to which command. 

Event: when you want to perform an operation we could trigger an event.. We could pass data into the event too..

Command: At last we are here.. This would perform all the dirty operations talking to database updating the model variables  handling results and all that.. They say the model variables can be touched only by the command ..


service: it holds the declaration of the remoteObject ,Httpservice and all that Just the declaration thats all..

Delegate: Now the command is really over stressed so lets delegate some part of the work. The delegate will talk to the service and handle the remote calls..

Who should bear the results.

The responder is responsible to handle faults and results..

So the command now modifies the model variables and ta da thats cairngorm...

It sounds wierd right.. 

Visit davidtucker.net for some fantastic video tutorials.

The other sites..

cairngormdocs.org
the adobe labs site for cairngorm..

By the way there is a sample application that I promised and here it is


No comments: