PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: Thomas B. on February 19, 2008, 04:54:17



Title: MacroCommand
Post by: Thomas B. on February 19, 2008, 04:54:17
Hi,

A MacroCommand dispatches its Notification to all of its sub commands.
But how could we dispatch only an identified part of the body to a particular sub command ?

Exemple :

MyMacroCommand receives [A, B, C] as body of its Notification.
We would like that subCommand1 deals with A, subCommand2 with A and B and subCommand3 with A and C.

(These 3 sub commands are used independently elsewhere in the App...)

Thanks, in advance...

Mo&Th


Title: Re: MacroCommand
Post by: puremvc on February 19, 2008, 06:42:01
The beauty of the MacroCommand is it doesn't need any logic, just a stack of SubCommands to notify.

In your situation the simplest answer, since the other Commands are already registered and usabe independently is to use another SimpleCommand.

In its execute method, send 3 notifications, each with the correct part of the 3 part note body that was received.

-=Cliff>


Title: Re: MacroCommand
Post by: Thomas B. on February 20, 2008, 02:59:30
Ok ok...

Thank you very mych.