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

Show Posts

* | |

  Show Posts
Pages: 1 [2]
16  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: January 18, 2008, 11:00:27
I had some time to consider this problem and I have come to some solution which I think can do it. It has some drawbacks but allows unregistering of all commands, mediators and proxies when the module unloads.

 I have attached a source of the module test application. It simply loads 2 modules which both use puremvc.
 In main application I have created ModuleMediator which controls loading and unloading of modules. As a helper class i have used ModuleFacade (it is located in the "util" package). ModuleFacade is a singleton which contains reference to the ApplicationFacade object (which is not needed because it is also singleton but it was kinda clearer this way for me). ModuleFacade controls registering and unregistering of modules.
Every module has a ModuleContext associated with it and it is available through ModuleFacade. ModuleContext holds all module registered commands, proxies and mediators.

The only thing that one have to do when creating a module is to create its startupclass which will initialize startupcommand.
 
In this command we have to register other things through the reference of ModuleContext object.

I'll continue on testing the solution and I would be glad to hear some comments.
17  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: January 14, 2008, 08:16:43
Hello,

  did you come to some good solution? I just started making modular app with flex and PureMVC and I ran into the singleton problem. The solution with passing the ApplicationFacade object is nice but it is not easy to handle registering and unregistering Mediator, commands and proxies.

I was thinking of making ModuleProxy that will handle registration. In this case the registration of meditarors will have to be called in the folowing manner:

:
moduleProxy.registerMediator(MediatorObject)
and similar for other registrationgs. ModuleProxy will be registered uppon moduleload and every time something is regitered through it, it will keep the info about registered medators, commands and proxies in array so on Module onload it can be easily unloaded.

This is the first thing that came across my mind and I don't really like the solution but it will work. The problem is that when somebody develops the modules he has to be aware of this so the module will not be so independent.

Any other idea?
Pages: 1 [2]