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.