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 ...

Get Professional Cairngorm™ 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.