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]
Author Topic: Need some general advice on application design  (Read 4255 times)
Posts: 4

View Profile Email
« on: November 27, 2008, 04:41:50 »

Hi folks,

I have been using PureMVC (single core) for about 8 months now together with AS3/Flex.  I have been learning AS3/Flex and PureMVC at the same time.  The project I am working on right now is a CRM system, so its core components are very easily broken into modules.

I got to a point where I need to have multiple instances of the same view and/or mediator and to be able to handle them.  This part I have done using the singleton puremvc, however I find it cumbersome and might create issues later.

I have just started reading a few days ago about PureMVC Multicore, and I understand it for the most part.  I still need some more time to soak in how the communication is done between individual modules and how to load/unload modules on the fly.

This is where I need advice.  I am thinking of taking each module from my application, and put it in its own application.  So right now, we have requirements for 9 modules.  I want to create these modules as independent applications (using PureMVC singlecore or multicore? ) and then creating a 10th "Main" application, which will incorporate these modules. 

What does everyone think? The other option is to start up a new project using the multicore and code everything as a whole application.  I am a little pressed by time and I don't know which route to take.

I really hope my question makes sense and thanks a lot in advance for your help!
Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #1 on: November 28, 2008, 09:58:58 »

I would suggest migrating your Standard version app to MultiCore. This alleviates the singleton issues with with modules, and actually makes testing easier.

Check out PipeWorks and Modularity. These demos focus on inter-module communications and not loading/unloading as there is plenty of documentation on that in Flex.

Also, don't be fooled by the structure of those projects, which are packaged for ease of downloading and running.

In reality you usually have several projects.

 * One project for your main app,
 * At least one for your modules (if not several that group modules, or even one per module).
 * One or more library projects where you put classes that you share between the other projects so that they don't depend on each other or duplicate classes.

Compile your modules and libraries to make all their dependencies external, so that PureMVC, Pipes, Flex and any other dependencies are expected to be present in the main app, and aren't being compiled into your module.

Compile your main application to include these libraries. This may make the main app a little larger but the modules will be small and efficient.

Make sure the loaded modules have access to the classes (research ApplicationDomain). Either load the modules into the main app's ApplicationDomain, or make the classes available to the domain the module is loaded into.

Module loading and unloading is easy. You just need to manage them and plumb them for communications, so they can collaborate. There are many topologies, so you are the plumber. If you have a non-trivial module setup, you might look at the Fabrication framework which builds on MultiCore for this purpose: http://www.dzone.com/links/rss/fabrication_simplified_puremvc_multicore_modules.html

Pages: [1]