Skip to Main Content
Professional Cairngorm™
book

Professional Cairngorm™

by Jeremy Wischusen
November 2009
Intermediate to advanced content levelIntermediate to advanced
357 pages
8h 20m
English
Wrox
Content preview from Professional Cairngorm™

7.2. What Do They Look Like?

The classes and interfaces associated with the Cairngorm commands are located in the com.adobe.cairngorm.commands package. This package contains the following classes and interfaces:

  • 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: Enforces the contract between the FrontController and concrete command classes in your application

  • Classes

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

The Command interface has been deprecated in favor of the ICommand interface. The code for the ICommand interface is as follows:

package com.adobe.cairngorm.commands
{
   import com.adobe.cairngorm.control.CairngormEvent;
   public interface ICommand
   {
      function execute( event : CairngormEvent ) : void;
   }
}

This is the interface responsible for enforcing the implementation of the command design pattern. It defines a single method, execute, that takes in a CairngormEvent class.

The SequenceCommand class is more or less a utility class that enables you to chain calls of commands together. The code for this class is as follows:

package com.adobe.cairngorm.commands { import com.adobe.cairngorm.control.CairngormEvent; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional Java® JDK®, 6th Edition

Professional Java® JDK®, 6th Edition

W. Clay Richardson, Jeff Scanlon, Donald Avondolio, Mark W. Mitchell, Scot Schrager

Publisher Resources

ISBN: 9780470497265Purchase book