Sequencing multiple commands December 24, 2006

Posted by Bjorn Schultheiss in : Cairngorm, Cairngorm Code Examples, Flex 2 , 18 comments

In your cairngorm Flex 2 application you may require to string a sequence of commands together. This may occur in your application’s initialization process or in the view from a user gesture.

For example, in the case of an e-commerce application on initialization you may be required to get all categories, sub-categories related to a category and the products related to a sub-category all in one process.

In cairngorm each command requires an event to be fired in order to execute the command. Now where you create that next event to be fired is usually in the subsequent command, prior to setting it to that command’s nextEvent property.

Perhaps this approach may not be suitable depending on your commands (as in one my cases) so i created a utility for chaining events together so that a sequence of events can be fired at the developer’s desire.

To demonstrate a scenario of the usage of this utility i have created a small example (click here and right-click to download source) and an illustration of the example.

Event Chaining Diagram

What i’ve done is create a sub-class of CairngormEvent which has a public property called nextChainedEvent.
Then I’ve create a utility class called EventChainFactory with a method chainEvents, which accepts an array of ChainEvent instances as its only parameter with each event in the array ordered in the order you want your sequence of events fired in. The method returns a ChainEvent instance with each subsequent event set to the next event’s nextChainedEvent property.

Enjoy and dont hestitate to improve it.

Regards,
Bjorn Schultheiss

Chen Bekor’s “CairngormStore with Stub BusinessDelegates” Example December 3, 2006

Posted by Douglas McCarroll in : Cairngorm Code Examples , 2 comments

Created by: Chen Bekor

Uses Cairngorm version: 2.1, 2.2.1

Supported/maintained by Adobe: No

You’ll find the 2.1 version here and the 2.2.1 version here.

Note to readers: We (the CairngormDocs community) are using these ‘Cairngorm Code Example’ blog posts as a quasi-wiki for posting examples. What this means is that any and all notes, explanations, comments and opinions relating to this example can be found in this post’s comments. We invite you to contribute!

(Search tag: Flex)

Derek Wischusen’s Ruby on Rails & WebORB “Issue Tracker” Example December 2, 2006

Posted by Douglas McCarroll in : Cairngorm Code Examples , 1 comment so far

Created by: Derek Wischusen

Uses Cairngorm version: 2.1

Supported/maintained by Adobe: No

This sample app is part of the Flex Ruby On Rails SDK, which you can find here.

Note to readers: We (the CairngormDocs community) are using these ‘Cairngorm Code Example’ blog posts as a quasi-wiki for posting examples. What this means is that any and all notes, explanations, comments and opinions relating to this example can be found in this post’s comments. We invite you to contribute!

(Search tag: Flex)