Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Backed into a corner with Single Core  (Read 9446 times)
jgervin
Courseware Beta
Sr. Member
***
Posts: 50


View Profile Email
« on: May 22, 2009, 01:43:31 »

So I have this fairly large Flex/AS3 application built on Single Core PUREMVC. I was 95% done with the project (think google maps for it networks) and now they want a new view, which does half what the old did and half a bunch of new stuff.

So what I tried to do is keep Single Core version and when they switch views send a TEARDOWN notification so all mediators and proxies get removed.  Then I create the new view, but half my functions don't work and I have a feeling the new view is getting hold of the old mediators somehow? I can't seem to track down why things aren't working, for instance in my displayMediator I have a reference to something on the mainstage and when I try to reference the mainstage in the new displayMediator it comes back null.

So knowing its a google maps type app where I have a couple of zoom / pan controls which always need to be on top of the stage what do I do next?  Would switching to multicore be the solution please say no as I can't imagine how many hours its going to take to transition everything over?

Help me please  :-[, Jason
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: May 22, 2009, 01:56:05 »

Step 1) Pushback. It is your responsibility as architect to ensure that the integrity of your client's application is not crippled by last minute game changing additions that require major architectural changes.

Step 2) After your almost certain defeat with Step 1, make sure you're using FlexBuilder, and understand how to debug properly with it.

Make sure that your TEARDOWN note is getting rid of everything. If you're using FB, the debugger can always show you every object in memory. In a Standard Version app, this means simply setting a breakpoint in a command, mediator or proxy, and inspecting the facade property, from which you can see the model, view and controller properties, which have proxyMap, mediatorMap and commandMap properties. Open facade.view.mediatorMap, and you'll find all the mediators. It's pretty easy to see if you've cleaned up or not.

Note that in the variables view, in the Flex Debugger perspective, you should check in the Flex menu (down arrow on right side) the 'Show inaccessable member variables option, so that you can see private and protected properties.

-=Cliff>
Logged
jgervin
Courseware Beta
Sr. Member
***
Posts: 50


View Profile Email
« Reply #2 on: May 22, 2009, 09:51:40 »

How difficult would it be to go multicore?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: May 23, 2009, 07:33:45 »

I don't know how big your app is, but it should be a pretty straight forward process. Mostly changing imports, changing the facade's getInstance method slightly, calling it with a name, and being sure that all your mediators and proxies wait until onRegister to do any facade manipulations instead of in their constructors. That's about it.

-=Cliff>
Logged
jgervin
Courseware Beta
Sr. Member
***
Posts: 50


View Profile Email
« Reply #4 on: May 24, 2009, 12:45:21 »

Thanks will see what I can do.
Logged
nilsm
Jr. Member
**
Posts: 19


View Profile Email
« Reply #5 on: June 01, 2009, 04:07:53 »

Hi jgervin,

I recently changed a fairly large app over to multicore. Your mileage may of course vary but it took about 30 minutes of global search/replace action.

Another good debugging tool is the free PureMVC Console from KapIT which will show you which mediators are still registered so you can track whether or not things get removed during the TEARDOWN.

(http://labs.kapit.fr/display/puremvcconsole/PureMVC+Console)

- Nils.
Logged
jgervin
Courseware Beta
Sr. Member
***
Posts: 50


View Profile Email
« Reply #6 on: June 04, 2009, 09:58:31 »

Thanks Nils
Logged
eco_bach
Courseware Beta
Sr. Member
***
Posts: 81


View Profile Email
« Reply #7 on: July 11, 2009, 07:26:16 »

Unfortunately the PureMVC Console is for flex only projects, no?
Logged
Pages: [1]
Print