package oreilly.cookbook.cairngorm.controller { import com.adobe.cairngorm.control.FrontController; import oreilly.cookbook.cairngorm.commands.RecipeCommand; import oreilly.cookbook.cairngorm.events.RecipeEvent; publicclass Controller extendsFrontController { publicfunction Controller() { super(); /*Command是用CairngormEvent的名字注册的。在本例子中,RecipeEvent.GET_RECIPE会创建并运行一个新的RecipeCommand:*/ // In this simple example there is only one Command that needs to be added // to the controller, but usually there are far more Commands to be added // when the controller is initialized. addCommand(RecipeEvent.GET_RECIPE, RecipeCommand); } } }