5.3. How Do You Create it?

You create an application-specific FrontController by extending the com.adobe.cairngorm.control.FrontController class. The application-specific FrontController is the class that you will use to register the event and command classes for the application you are currently building.

The location of the FrontController will vary depending on what example you are looking at.

For instance, the FStop application example from the "Flex 3: Introducing Cairngorm" article creates it in the business package, as shown in (Figure 5-1).

Figure 5.1. Figure 5-1

However, the Cairngorm store example creates it in the control package, as shown in (Figure 5-2).

Figure 5.2. Figure 5-2

For the purposes of creating an example FrontController, we'll use the business package.

To create a FrontController class, start as you would in creating any new class, but stop when the New ActionScript Class dialog box appears. Again, many developers will create the FrontController class by prefixing the word controller with the name of the application or some other descriptive label, as shown in (Figure 5-3).

Figure 5.3. Figure 5-3

To set the superclass to the com.adobe.cairngorm.control.FrontController ...

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.