PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: manoharbabu.kollipara on May 26, 2009, 11:46:05



Title: Executing Command Class based on Conditions
Post by: manoharbabu.kollipara on May 26, 2009, 11:46:05
Hi Cliff,

Is there is any Way to execute a set of command class or skip a set of command classes based on any conditions . I am already that command classs are registered to the Facade at the startup only.

Thanks & Regards,
Manohar.Kollipara


Title: Re: Executing Command Class based on Conditions
Post by: puremvc on May 27, 2009, 06:22:58
Commands can be registered or unregistered at any time, not just at startup. You can register or unregister them when the conditions become appropriate.

Or you can trigger a 'guard' command that makes an evaluation and conditionally sends a notification that triggers a simple or macro command. For that matter, a mediator or proxy can make the decision about whether to send the notification or not if it has the info needed. Or the command itself can evaluate conditions and exit if conditions aren't met.

So you can do the conditional evaluation anywhere you choose, really.

-=Cliff>