16 Reusing Commands with Prana Sequences

Goal

You’re using Cairngorm, and you want to describe sequences of events that take place on certain user actions. These sequences of events involve different commands that you’d like to keep separate from each other, so that each remains reusable in the maximum number of scenarios.

Solution

Use Prana (http://pranaframework.org) and its EventSequence class to describe a sequence of CairngormEvents, the properties of which, when changed, should trigger them.

Sequences

Keep your Cairngorm commands reusable by keeping them from knowing too much about other commands. Commands should be as atomic as possible; to use a time-honored phrase, they should do one thing and do it well. If ...

Get Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.