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]
1  Announcements and General Discussion / Architecture / Re: Connecting modules on: June 15, 2009, 09:27:37
Ok that makes sense.

What if I load a module after the user has logged in and that module needs to check the logging status - would the best way to do that be to create a dedicated out/in pipe from the loaded module to login module and then an in/out pipe from login to module, then send a message requesting the login status, or would a single check like that go through the shell (or am I going about this in the wrong way)?
2  Announcements and General Discussion / Architecture / Connecting modules on: June 15, 2009, 10:32:42
Hi (again)

My current issue is not so much a problem just a question of which would be the best way of doing something.

I have a shell that loads in a few modules dynamically. each module has the pipefittings to communicate back and forth with the shell. One of the modules is a login module. Once the user is logged in other modules need to get information to display regarding the user - and other modules need the information to later be able to do tasks reserved for registered users.

Currently the way I have this set up is:
- User clicks login and proxy logs user in
- Proxy sends notification with userVO
- LoginModuleJunctionMediator gets note from proxy and sends a message to shell with userVO
- Shell sends message on down the STNOUT pipe to any module interested in the login message

Not sure if the ShellJunctionMediator should send the message on directly when it is received in its pipe message handler or send it on to the Shell Mediator which in turn sends it back to the ShellJunctionMediator which sends it on to the modules (just to keep with the structure)

My question is - does this flow seem like a logical way of doing this or will I end up with spagetti piping and there is a better way to go about this that is eluding me.

Thanks!
3  Announcements and General Discussion / Architecture / Re: Basic Pipes question on: June 08, 2009, 04:55:44
Wow - sometimes I really live up to my username...

The reason the MODULE_TO_SHELL_PIPE worked for one of the modules is that I noticed that I forgot to add the "default" case for the switch statement in the "handleNotification" method in the ModuleJunctionMediator. The very same that is supposed to handle ACCEPT_OUTPUT_PIPE and ACCEPT_INPUT_PIPE...

Unfortunately it took me until now ( about 5 hours ) to realize that I had missed adding it to the remaining two modules... hence output is returned null for two of the three pipes in the list.

Air in - frustration out. Yay brain!

Again thanks for listening to my ramblings - the debugger definitely helped me narrow the issue down.
 
4  Announcements and General Discussion / Architecture / Re: Basic Pipes question on: June 08, 2009, 03:43:30
Hi Cliff - thanks for your quick reply - appreciate it!

You are correct - I was not using the Debugger - had the wrong version installed of the debugger player...
I installed the correct version and ran it with breakpoints when I send the message and it's telling me that the "shellOutFitting" is null. I'm not exactly sure why it is referencing that var by name since it is a local var in the function connecting the modules to the shell.

From what I gather the issue is with the write method on the pipe - the "output" in the pipe is returning null.

My head might not be quite around this yet, but when I look at how the pipes for modules are connected they never supply an output to the Pipe - either via constructor or via "connect" method.

var shellToModule:IPipeFitting = new Pipe( );
module.acceptInputPipe( PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE, shellToModule );
         
var shellOutFitting:IPipeFitting = junction.retrievePipe( PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE ) as IPipeFitting;
shellOutFitting.connect( shellToModule );

So am I looking at the wrong pipe? Should I be looking at the TeeSplit coming out from the Shell?

Thanks!
5  Announcements and General Discussion / Architecture / Basic Pipes question on: June 08, 2009, 01:43:28
Hi,

I'm just starting to work with pipes and I've run into a problem that is probably very basic, but the solution is eluding me...

I'm trying to do a simple framework where the shell has three modules and they can send messages back and forth. I used the PipeWorks and GarbageCollectionPipes demos as a base.

I create and connect the modules fine - they show up in the framework and I can send messages from the modules to the shell ( in the MODULE_TO_SHELL_PIPE ) However when i try to send messages the other way ( in the  SHELL_TO_MODULE_PIPE ) it fails. The chain stops when I try to send the mesage:

junction.sendMessage( PipeAwareModuleConstants.APP_TO_MODULE_PIPE, new Message( PipeAwareModuleConstants.APP_TO_MODULE_MESSAGE, null, note.getBody( ) ) );

I can see an Alert that happens before the call, but not after so I'm assuming it fails silently somewhere in the sending process.


I did one thing that might cause this ( can't really see where it would, but I'm a newbie ) - I wanted to be able to load MXML modules and not AS modules so I changed the "PipeAwareModule" to extend "Module" instead of "ModuleBase". Then I added a public "init" function that is overridden by modules extending "PipeAwareModule". I also added a "setFacade" since the MXML module does not have a constructor where it can pass that to super. This all happens before i try to connect the module to the Pipes so the facade is available when the ACCEPT_INPUT_PIPE and ACCEPT_OUTPUT_PIPE notifications are sent.

This might be the totally wrong way to approach this - and I'm very open to suggestions - but it seems to connect fine since I can send messages from the modules to the shell. (But not the other way around...)
'
Sorry for the lengthy explanation - if anyone has experienced anything similar, or see something inherently wrong with what I've tried to do I'd really appreciate any help I can get

Thanks!
6  Announcements and General Discussion / General Discussion / MultiCore load module into another module issue on: April 07, 2009, 05:56:20
Hi,

I'm having a frustrating problem with loaded modules:

In my application I load modules into other modules at run time. All modules are loaded using the module manager and everything loads fine. The problem happens with any outbound notifications originating from the modules loaded at run time into another module - they are being sent twice.

If the same module is loaded into the main shell instead of into another module the notifications behave as expected.

I know there isn't much info to go on - and no source code, but if it sounds familiar I'd really appreciate if anyone has experienced a similar problem and found a solution.

Thanks!
Pages: [1]