Elephant
|
![](http://forums.puremvc.org/Themes/PureMVC/images/post/xx.gif.pagespeed.ce.G0yTW6LI8E.gif) |
« on: July 16, 2010, 10:48:30 » |
|
I'm working on a PureMVC Multicore application that has several Flex Modules. There's a bunch of stuff common to all the modules, so I'm having several classes in each module inherit from base classes.
One of these base classes is a CommonStartupCommand, registered to the "startup" Notification in the CommonFacade.
Each module will have a couple of other things to start up, so I have a separate ModuleStartupCommand in each one of those, too. Unfortunately, I can't just register that command to "startup", too; it'll replace CommonStartupCommand instead of acting in tandem with it. At this point, I'm weighing two possible architectures to handle this:
One, the ModuleStartupCommand extends CommonStartupCommand, and the execute() function calls super.execute().
Two, implement ModuleStartupCommand as a MacroCommand, calling addSubCommand on both common and specific startup commands.
From what I've read here, option 2 seems more in line with the design philosophy of PureMVC, but option 1 seems a little simpler ... and I haven't seen *any* examples of this type of inheritance between Commands.
Got any advice for me?
|