5.5. Summary

In this chapter you looked at the Cairngorm FrontController class. The FrontController has the following characteristics:

  • It intercepts dispatched business events and forwards each event instance to the appropriate command instance for processing.

  • It serves as a registry of event-to-command mappings of Cairngorm event and command classes.

The location of the FrontController class in a Cairngorm application may vary, but is typically found in either the business package (as in the FStop application ) or the control package (as in the Cairngorm store example).

You create a specific FrontController class (e.g., CairngormExampleController) by extending the com.adobe.cairngorm.control.FrontController class.

An instance of the FrontController class must be included in the application so that Cairngorm events can dispatch to it.

You add event-command pairings to the FrontController by calling the addCommand function and passing it the event type and command class.

You do not need to directly reference the instance of the FrontController class, as the details of doing so are taken care of for you when you call the dispatch method of a Cairngorm event class.

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.