from PureMVC to RobotLegs...bestPractices for startup
Ok
Need some help as I get up to speed with RL.
1
To start, am I correct in thinking of Context as Facade in
PureMVC?
2
Is a Startup Command necessary?
3
How would I translate the following (from Application facade and
StartUpCommands in PureMVC) in my ApplicationContext file?
//CODE START //StartupCommand start facade.registerProxy(new
DataProxy(app));
facade.registerMediator(new StageMediator(stage));
facade.registerMediator(new ApplicationMediator(app));
//StartupCommand end //ApplicationFacade start
override protected function initializeController():void
{
super.initializeController();
registerCommand(Constants.CMD_STARTUP, StartupCommand);
}
public function startup(stage:Object):void
{
sendNotification(Constants.CMD_STARTUP, stage);
}
//ApplicationFacade end
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Jonny Reeves on 23 Mar, 2010 11:00 AM
Hi There,
Your formatting got a bit screwed up there, but I think what you're looking for is ContextEvent.STARTUP_COMPLETE, for example:
To answer your questions directly; most people are content with putting their Command Mappings, Mediator Mappings and Injector Mappings into their Context's startup() method. However, I personally prefer to have a Bootstrap Command which itself calls a chain of Commands to get things setup and ready to roll.
Jonny.
Shaun Smith closed this discussion on 20 Jun, 2010 04:24 PM.