PureMVC Architects Lounge

Announcements and General Discussion => Fabrication => Topic started by: gunslinger4hire on March 30, 2009, 11:24:02



Title: SOLVED: Routed Notification triggers registered command 4 times
Post by: gunslinger4hire on March 30, 2009, 11:24:02
Hi...

Great work done with fabrication... Simplifies multicore apps a lot.

I have now a flex application with a lot of modules. and some modules are loaded by modules.
so i have a slight nested module setup.

example:

MainApplication -> loads -> Module A
                                      Module B -> loads -> Module C
                                                                   Module D
                                                                   Module E
                                      Module F

Now i try to route a notification from Module C to a command registered in the MainApplication. The notification gets handled by the command, but 4 times. Even when i use a mediator with respondTo<NOTIFICATION> the mediators respondTo Function is called 4 times.

I appreciate all help..
Thanks Oliver


Title: Re: Routed Notification triggers registered command 4 times
Post by: gunslinger4hire on March 31, 2009, 04:57:18
Problem solved...

I thought i was clever and did not extend the SimpleFabricationCommand for the Modules StartupCommand. Instead i used the ModuleStartupCommand and extended this one.

Bad thing...


Title: Re: SOLVED: Routed Notification triggers registered command 4 times
Post by: Darshan Sawardekar on April 01, 2009, 08:15:21
@gunslinger4hire

Glad you got it solved. I one of the things that might help with lots of module is to use module groups. This is present in 0.6 but not documented well right now. The idea is to assign a group name to a module. So routed notifications stay with a group, similar to created a subnet on lan. See this post[1] for more.

peace,
darshan

[1] : http://forums.puremvc.org/index.php?topic=874.msg4000#msg4000