Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
addSubCommand( ModelPrepCommand ); addSubCommand( ViewPrepCommand );
protected function addSubCommand( commandClassRef:Class ): void { subCommands.push(commandClassRef); }
public function MacroCommand() { subCommands = new Array(); initializeMacroCommand(); }
override protected function initializeMacroCommand() :void { addSubCommand( ModelPrepCommand ); addSubCommand( ViewPrepCommand ); }
commandInstance.execute( note );
public final function execute( notification:INotification ) : void { while ( subCommands.length > 0) { var commandClassRef : Class = subCommands.shift(); var commandInstance : ICommand = new commandClassRef(); commandInstance.execute( notification ); } }
public function registerCommand( notificationName:String, commandClassRef:Class ):void { controller.registerCommand( notificationName, commandClassRef ); }
registerCommand( STARTUP, ApplicationStartupCommand );
so when I call registerCommand( STARTUP, ApplicationStartupCommand ); in the ApplicationFacade.as and then calls controller.registerCommand, and in this function executeCommand is called
view.registerObserver( notificationName, new Observer( executeCommand, this ) );