puremvc
|
|
« Reply #1 on: August 13, 2008, 08:25:05 » |
|
Unless there's an overarching reason for jumping through hoops to defer the registration of LoginProxy and LoginCommand, I'd just do them at the start. It doesn't sound like you have terribly complex application, the only issue is in when does the LoginCommand get triggered, or when does the Proxy get called. If you set everything up normally and then control the order in which notifications are sent, then you'll have a simpler application.
This isn't to say that deferring instantiation of actors isn't ever necessary, but usually it's a Mediator being deferred because the view component it mediates hasn't been instantiated by the view just yet. Proxies and Commands occasionally need to be deferred as well if you have a really huge app with lots of them and you're never sure which will be used during a given session. But again, this adds complexity to your app since the registrations happen in multiple places, and should only be done if it's absolutely necessary.
It's sort of like going to a shoot out but leaving the gun empty till you get there because that's when you expect to use the bullets. Safer true, but a gunslinger generally doesn't fire till he needs to, and fumbling bullets into the chamber while facing down the opponent in the street at high noon is less cool (and arguably more dangerous) than just popping open your holster snap and standing ready.
-=Cliff>
|