// you’re reading...

Featured

Things to watch for when Porting from PureMVC to PureMVC multicore

So you’ve built the majority of your application in PureMVC and now you wanna lob a module or two in there.  Go ahead.  Add that excitement to your day.  I had the pleasure of doing just that when I was a few hours from milestone- or so  thought.  Here are a few of the gotchas to watch out for.

  1. You’re going to need all of your code to be coming from the same PureMVCcodebase with the path of   org.puremvc.as3.multicore.[rest of everything]  you can approach this many ways.  You can waste away your youth going through the errors in the problem view and watching your code dance back and forth between the two namespaces and the odd errors that come with that.  Try to compile,  rip out some hair, and grab the next red output.  but I recommend the following:   1.  Remove the single core version of pureMVC from your libs or externals folder depending on which approach you used. 2.  Within your source(ONLY Your code and not the library)  you want to do a find and replace of “org.puremvc.as3.“  with     “org.puremvc.as3.multicore.” .  For the sake of your sanity, please make sure that you don’t let this sneak into your externals folder if you like to code with the source instead of .swc files.  If not you will end up with a bunch of “org.puremvc.as3.multicore.multicore.“.  Just trust me on this.
  2. If you’re using the Pipess approach instead of the Modular approach(see the site for the difference) then go ahead and download the Pipes utility.
  3. The multicore Pipes approach is using a Multiton instead of a Singleton so ApplicationFacade.getInstance() now requires a parameter NAME to ID the requesting application so use ApplicationFacade.getInstance( NAME ).startup( this );
  4. The constructror of your ApplicationMediator is probably calling facade.registerMediator(new BlahMediator(…)).  This will result in Error: multitonKey for this Notifier not yet initialized! because the facade does not exist yet.  The calls to facade.[anything]() will need to take place after the initializeNotifiers() call. The reccomended place for initialization and setup stuff  is in an override of onRegister().  (see more in these two posts (post 1, post2).   I believe it’s also best practice to put your eventListeners in the onRegister() override.

Just thinking through these in my head.  I welcome any feedback or hints.  I’ll add to this as this process goes on.

update:  Just came across an excellent entry on lowpitch.com addressing the same issue.

Technorati Tags: , ,

Discussion

4 comments for “Things to watch for when Porting from PureMVC to PureMVC multicore”

  1. Nice post… I also went through this process fairly recently. I wrote a little more about issue 4 here, http://lowpitch.com/blog/2008/07/23/puremvc-multicore-vs-standard-singlecore/ , but there’s nothing there that you’ve not covered.

    Good tips!

    Posted by Toby Ashley | August 11, 2008, 11:44 am
  2. [...] Things to watch for when porting from PureMVC to PureMVC MultiCore. [...]

    Posted by PureMVC Multicore « The Algorithmist | August 20, 2008, 7:55 am
  3. so… diamond tearz, eh? with the “z”? …

    Posted by brendan | September 8, 2008, 7:50 pm
  4. I think the link referred to in (2) which dealt with the differences between pipes and modules, should be

    http://puremvc.org/content/view/75/181/

    the supplied link was the homepage which must get changed on new content..

    Posted by Pete | September 15, 2008, 5:30 am

Post a comment