O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required