Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
December 12, 2017, 08:22:06 PM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Print
Author Topic: moving from single core pureMVC to Multicore pureMVC  (Read 2669 times)
amerineni
Newbie
*
Posts: 2


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

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
« Reply #1 on: February 17, 2010, 10:38:52 AM »

Quote
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.

Quote
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.

Quote
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?

Quote
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.

Quote
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 AM by puremvc » Logged
Pages: [1]
Print
Jump to: