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: moving from single core pureMVC to Multicore pureMVC  (Read 6378 times)
amerineni
Newbie
*
Posts: 2


View Profile Email
« on: February 17, 2010, 09:26:58 »

Hi

we are planning to move to multicore PureMVC and divide each view into modules.  I have the following questions

1)      We are planning to have only one module loaded at a time. In this case, how can I approach In order to pass data from the existing module to the module being loaded(next module)?

2)      Can we talk to the main application using the notifications or do we need to use the pipes utility? My understanding is that pipes is mainly used for communication between modules

Which are available at the same time and for communication with the main shell?

3)      We are currently not using proxy for storing data, but using for handling the result and fault handlers and having methods which can be called from mediators. Do you think it’s a good way

If I use my shell proxy(Main applications proxy ) like a model locator in cairngorm with different attributes?
4) Any other best practices or suggestions using multicore pureMVC


Your suggestions will be really helpful. Thanks in advance.

 

Vin a
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: February 17, 2010, 10:38:52 »

1)      We are planning to have only one module loaded at a time. In this case, how can I approach In order to pass data from the existing module to the module being loaded(next module)?
I would suggest having a long-lived model module that each successive loaded module communicates with.

2)      Can we talk to the main application using the notifications or do we need to use the pipes utility? My understanding is that pipes is mainly used for communication between modules

Use Pipes and Messages if possible. Or interfaces and events. Otherwise you have the problem of maintaining your notification namespace between cores.

3)      We are currently not using proxy for storing data, but using for handling the result and fault handlers and having methods which can be called from mediators. Do you think it’s a good way
If you need to persist data between module loadings, you probably do want to store the results in the Proxy or you'll end up making the calls again, right?

If I use my shell proxy(Main applications proxy ) like a model locator in cairngorm with different attributes?

Then you use an interface to define the shell and all its methods (and properties can be governed by defining get and set methods on the interface) and all modules need a reference to the shell. It's not the best arrangement (See the answer to #1), but it works. See the Modularity demo for interface/event communications.

4) Any other best practices or suggestions using multicore pureMVC

  • Change all your imports (org.puremvc.as3.* -> org.puremvc.as3.multicore.*)
  • Rewrite your Facade's getInstance method. You can pretty much copy and paste the one from PipeWorks, for instance.
  • Put all your shared view components, constants, etc into a 'common' package. Other than that, each core (modules and shell) all have the same structure as a standard version app, it's very fractal. Here's a recommended project structure: http://forums.puremvc.org/index.php?topic=1308.msg6048#msg6048 This makes it easy to split into multiple projects if and when you should need to.
  • Make sure you're not doing any facade manipulation in the constructors of your proxies and mediators. Pretty much move everything but the call to super into the onRegister method.
  • If you do need to break it into multiple projects, then learn ant and the Flex ant tasks. Once you've refactored, create a build script. Add each project to it as you go. You'll have a big target that builds the common library, all the modules and the application, with targets to build any one of them separately as you work.

-=Cliff>
« Last Edit: February 17, 2010, 10:51:27 by puremvc » Logged
Pages: [1]
Print