|
|
Show Posts
|
Pages: [1] 2
|
2
|
Announcements and General Discussion / General Discussion / Re: View component is null during startup?
|
on: August 05, 2008, 12:28:42
|
Hi,
If you are using the MultiCore version of PureMVC, then my first advice is to put the addEventListener() code into the onRegister() method of the mediator instead of the constructor.
Seeing the code snippets that you have provided, I could not find any problem. You said you were passing view.FooView to the FooMediator constructor. So FooView is the 'id' of the child in view object?
You said view.dummyButton is null. Did you check whether view itself is null?
You may also want to check whether the viewComponent is getting set properly in ApplicationMediator.
Ramanuja.
|
|
|
3
|
PureMVC Manifold / MultiCore Version / Re: Retrieving Proxy Between Modules
|
on: August 04, 2008, 09:54:12
|
Cliff,
Is it okay for one module to send a VO to another module? Sending a proxy itself sounds very wrong as you mentioned. I have had this doubt for quite a while.
When using webORB's setCredentials(), we need to pass in the username and password right? The LoginVO that contains this data may be a part of the Shell.
How do I send across these details to a module that wants to set these credentials?
I hope I have stated my problem clearly.
Thanks, Ramanuja
|
|
|
4
|
PureMVC Manifold / MultiCore Version / Re: Pipes Utility - Disconnecting Pipes
|
on: August 04, 2008, 09:40:54
|
Cliff, 1. Does it make sense to have a Facade.hasCore() mehod to support the above post? (if its correct ) 2. In my ModuleJunctionMediator's onRemove() method: override public function onRemove():void { // Remove both pipes (shell -> module && module -> shell ) junction.sendMessage(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE, new Message(PipeAwareModuleConstants.MODULE_DISPOSED_MESSAGE, null, PipeAwareModuleConstants.MY_MODULE)); junction.removePipe(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE); junction.removePipe(PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE); } Will the message sent above reach the shell junction? This way, the hasCore() idea is not required. I feel the infinite loop is not a good design. Waiting to get your views on this. Thanks, Ramanuja.
|
|
|
5
|
PureMVC Manifold / MultiCore Version / Re: Pipes Utility - Disconnecting Pipes
|
on: August 04, 2008, 09:39:01
|
Hi,
Great learning for me from Simon's post about GC!
Is there a way to do this without the timer? I want the removeChild() to be executed as soon as the core is removed.
Lets say we want to remove a core CORE_NAME,
while (Facade.hasCore(CORE_NAME) != null) { // infinite loop }
// Now remove child app.removeChild(...); Thanks, Ramanuja.
|
|
|
6
|
PureMVC Manifold / MultiCore Version / Re: Pipes Utility - Disconnecting Pipes
|
on: August 01, 2008, 11:42:26
|
Hi, I like your implementation a LOT riafan. Its very neat. I have a couple of doubts. I am sure you can solve them for me 1. cachedFittings is a private var Array in the module right? So every module, has an array called cachedFittings that holds {local:localFitting,remote:remoteFitting}. Am I right here? 2. I have doubt with module.cacheFitting() method you mentioned. Should it not be module.cacheFitting(appToModule,appOut); // It was ...(moduleToApp,appIn) before ? 3. The DynamicTeeSplit which extends TeeSplit, has a method: public function disconnectFitting(output:IPipeFitting):IPipeFitting Is this implementation correct? public function disconnectFitting(output:IPipeFitting):IPipeFitting { for (var i:int=0;i<outputs.length;i++) { if (outputs[i] == output) { // Remove the ith IPipeFitting. outputs.splice(i, 1); } } return output; } Does garbage collection happen for the ith element that is discarded above?3. Is there no need for a DynamicTeeMerge? This question may be stupid but I just want to confirm. The moduleToApp pipe is connected to the TeeMerge of the app. I saw the implementation of TeeMerge.connectInput() method. The app maintains no reference to individual pipes that are merged right? How many ever modules may connect to the TeeMerge of the app. When unloading the module, it is sufficient to just execute the following? // This is a method in the module's junction mediator. override public function onRemove():void { // Remove both pipes (shell -> module && module -> shell ) junction.removePipe(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE); junction.removePipe(PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE); } junction.removePipe(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE); will remove the moduleToApp pipe completely? Will it be garbage collected? I have asked a lot of questions KEENLY awaiting your response. Thanks, Ramanuja.
|
|
|
7
|
PureMVC Manifold / MultiCore Version / Re: Retrieving Proxy Between Modules
|
on: August 01, 2008, 08:26:09
|
chitchu,
Have you considered Pipes? The solution that you are looking for may be Pipes.
Using pipes, ModuleB can send a message though a pipe connected to ModuleA requesting for the data that ModuleB wants. ModuleA can then send the data through another pipe that is connected to ModuleB.
This way, the two modules are decoupled.
Ramanuja.
|
|
|
9
|
PureMVC Manifold / MultiCore Version / Re: Pipes Utility - Disconnecting Pipes
|
on: August 01, 2008, 07:59:21
|
Hi, With reference to post by rifian ( http://forums.puremvc.org/index.php?topic=508.msg2165#msg2165), I have run into the same problem. I have build a sample app which uses pipes and dynamic loading/unloading of modules. In the ShellJunctionMediator, I have the following code: override public function onRegister():void { // The SHELL_TO_MODULE_PIPE pipe from the shell to all modules. junction.registerPipe(PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE, Junction.OUTPUT, new TeeSplit()); // The MODULE_TO_SHELL_PIPE pipe to the shell from all modules. junction.registerPipe(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE, Junction.INPUT, new TeeMerge()); // Add a pipe listener for incoming messages to the shell. junction.addPipeListener(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE, this, handlePipeMessage);
} ... ... override public function handleNotification(note:INotification):void { switch (note.getName()) { case ApplicationFacade.MODULE_ADDED: // Connect module passed in the notification body to shell. // Connect a pipe from module to shell. This pipe is output pipe for module and tee merge for shell. var module:IPipeAwareModule = note.getBody() as IPipeAwareModule; var moduleToShell:Pipe = new Pipe(); module.acceptOutputPipe(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE, moduleToShell); var shellIn:TeeMerge = junction.retrievePipe(PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE) as TeeMerge; shellIn.connectInput(moduleToShell); // Connect a pipe from shell to module. This pipe is tee split for shell and input pipe for module. var shellToModule:Pipe = new Pipe(); module.acceptInputPipe(PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE, shellToModule); var shellOut:TeeSplit = junction.retrievePipe(PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE) as TeeSplit; shellOut.connect(shellToModule); break; } } ... ... override public function handlePipeMessage(message:IPipeMessage):void { switch (message.getType()) { case PipeAwareModuleConstants.MODULE_DISPOSAL_MESSAGE: // Call the dispose method of the module. // HOW DO I REMOVE PIPES FROM THE SHELL TO THIS MODULE HERE??
var module:IPipeAwareModule = message.getBody() as IPipeAwareModule; module.dispose(); break; } }
// HOW DO I REMOVE PIPES FROM THE SHELL TO THIS MODULE HERE??I am doing, sendNotification(ApplicationFacade.MODULE_ADDED); each time I want to add a new module. Now when it is time to remove module 'x', how do I remove the pipes attached to module 'x' in the TeeMerge and TeeSplit? I do not want to do: junction.removePipe( PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE ); junction.removePipe( PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE ); because it will remove the pipes with other required modules as well. rifian said subclassing TeeSplit and adding public function disconnectFitting(output:IPipeFitting):IPipeFitting helped. But, how do I get a reference of the output:IPipeFitting that I must I pass to the above method? Please help!! Thanks, Ramanuja
|
|
|
13
|
PureMVC Manifold / Demos and Utils / Re: PipeWorks- a PureMVC AS3 MultiCore Demo
|
on: July 17, 2008, 01:25:52
|
Hi Cliff, I have a doubt with the PipeWorks demo. In "PrattlerModule.as", you are getting an instance of the ApplicationFacade with the key as "moduleID" which is an incrementing key. So each time I click on the "New Prattler" button, a new ApplicationFacade is instantiated with a unique moduleID. Now, when I close a prattler window, the mediators are being removed. What about the facade? Is it not a good idea to remove the facade as well since I feel this is a memory leak? Am I correct? Regards, Ramanuja
|
|
|
|
|