PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: Corax on June 15, 2011, 03:50:18

Title: Connection between modules
Post by: Corax on June 15, 2011, 03:50:18
Hi everybody,

I've a problem and I hope you can help me to handle it.

The scenario:
I have a multicore-app which contains an unknown number of modules. One of these modules is responsible for the login.
If the user logs in, the login-module sends a message to the shell which contains informations about the accessible modules.
To access these modules the shell has a buttonbar, which loads the module-links.
If the user clicks on one button, a module will be registered with all it's components. So far so good.
But know I would like to send data from the login-module directly to the new modules because in some cases I just want to show particular data.
What shell I do?

Title: Re: Connection between modules
Post by: puremvc on June 15, 2011, 07:51:01
There are two major approaches you can take here.

1) You can have the shell give the modules a reference to each other so that they can call methods on each other (or just one-way; the new module might know the login module, but not visa-versa). This approach will be most loosely coupled if you use interfaces to interact with rather than references to the module classes themselves.

2) You can 'plumb' it to the login module using the pipes utility. A pipe allows you to send messages to one or more modules connected to the pipe without having a reference to those modules.

If you aren't familiar with the Pipes utility, you can get a quick overview of it here:

And download it here: