14.1. Creating the FrontController

In order for Cairngorm events to be able to dispatch to the FrontController, there must be an instance of the FrontController in the main application. You will add this instance later in this chapter, when you set up the main application file.

To get started on this process, create a class named FlexBlogController that extends com.adobe.cairngorm.control.FrontController in the com.FlexBlog.controllers package. (See Chapter 5 for specific instructions, with screenshots, for creating a FrontController class.) Modify the class to look as follows:

package com.FlexBlog.controllers
{
  import com.adobe.cairngorm.control.FrontController;
  import com.FlexBlog.events.*;
  import com.FlexBlog.commands.*
public class FlexBlogController extends FrontController
  {
    public function FlexBlogController()
    {
      super();
    }
  }
}

Remember to add imports for your events and commands packages, since all your Cairngorm events and command classes will eventually have to be registered here. Since you do not currently have any classes in the events and commands packages, auto-complete will suggest only the controllers package (because that has the FrontController class in it), and so you will have to type out the names of the rest of the packages manually.

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.