PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: 2009 Matt on January 25, 2009, 02:57:24



Title: Difference between multicore and standard ?
Post by: 2009 Matt on January 25, 2009, 02:57:24
I'm new to PureMVC.

I know the implementation of standard version uses lots of singleton, but multicore.
Is there any difference in API level? Performance difference? Which one is a better choice for
a new Flex project?


Title: Re: Difference between multicore and standard ?
Post by: puremvc on January 27, 2009, 06:24:11
It is virtually the same. A map of singletons for the primary actors allows 1 per 'core' (i.e. Main app or loaded module/swf).

Performance wise there's only the overhead any modular project will have over and non-modular project.

Of course API wise there are methods for adding, removing and checing for the existence of cores by name. And getInstance for the MVCF actors takes a string for the core name, as each needs a unique key.

And in the MultiCore version you must not try to access the local reference to the Facade in your Mediator or Proxy constructors, as they will not be given a reference to their Facade until initializeNotifier is called. However it turns out that it is a best practice in both versions to wait until onRegister anyway, because you don't want to start any conversations you're not registered and ready to participate in.

Other than that, the two versions are basically the same. I suggest starting projects that will be unit tested in MultiCore even if they aren't modular. This is because you can get a fresh 'core' for each test.

-=Cliff>


Title: Re: Difference between multicore and standard ?
Post by: yomane on February 26, 2009, 01:15:33
I have a question regarding multicore vs standard.

On the gwt port, it seems that there is a difference in the way to add subCommands in a MacroCommand. 

In standard version, MacroCommand.addSubCommand expects a reference to the command.class to be instanciated by the controller upon notified, as stated by the best practiced documentation.

:
    protected void addSubCommand(Class<? extends ICommand> commandClassRef) {
        this.subCommands.add(commandClassRef);
    }


With the multicore version,  MacroCommand.addSubCommand expects an instanciated ICommand object.  So, when should the command be instanciated then ? 

:
protected void addSubCommand( ICommand commandClassRef )
{
this.subCommands.addElement( commandClassRef );
}

Aside from the fact that the documentation refers to singletons only, are there other aspects of the multicore version that are not covered in the documentation ?

Thanks

Bruno



Title: Re: Difference between multicore and standard ?
Post by: puremvc on February 26, 2009, 06:13:18
Hi Bruno,

This is one best left for the Java MultiCore port owner. If you could repost there it might catch his attention. You're right, this shouldn't operate differently from the reference if possible.

-=Cliff>


Title: Re: Difference between multicore and standard ?
Post by: yomane on February 26, 2009, 06:44:54
Yep, you're right, wrong section.  Sorry.

Thanks for replying.