O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.5. Summary

In this chapter you looked at the classes and interfaces associated with Cairngorm commands. These included:

  • Interfaces

    • Command: Enforces the contract between the FrontController and concrete command classes in your application. Deprecated as of Cairngorm 2.1 and replaced by com.adobe.cairngorm.commands.ICommand.

    • ICommand: The ICommand interface enforces the contract between the FrontController and concrete command classes in your application.

  • Classes

    • SequenceCommand: The SequenceCommand is provided as a "pseudo-abstract" base class (since ActionScript has no real concept of abstract classes), which can be extended when you wish to chain commands together for a single user gesture, or establish some simple form of decision-based workflow.

Cairngorm commands have the following qualities:

  • Each command class represents a specific business feature with associated business logic and processing.

  • Commands update the ModelLocator with new data or changes to existing data.

  • All commands have the same entry point to initiate or start business processing: execute().

  • Command implementations have class names that are equivalent to business events (e.g., LoadPhotosEvent and LoadPhotosCommand).

Cairngorm command classes are generally created in a command package. The general naming convention is to prefix the word command with something descriptive about what the command does. It is also a convention that the prefix used for the command class and the prefix used for the corresponding event ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required