PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: bigTimeOperator on May 20, 2010, 11:55:30



Title: Retrieving data from outside of a module in a multicore application
Post by: bigTimeOperator on May 20, 2010, 11:55:30
Ok, I'm using fabrication, but I assume the question applies to any multicore puremvc application. Often I have one module that needs to pull data from the shell. For example my module might want to know if a user has logged in, but this data lives in shell model. So far my process has been for the shell to register a command to a request notification sent from the module and for the module to register a command for a release notification sent from the shell. Is this insane, or is that really the cleanest pure mvc approach? I feel like I'm beginning to overcomplicated what is normally simple task.


Title: Re: Retrieving data from outside of a module in a multicore application
Post by: puremvc on May 20, 2010, 02:28:09
my process has been for the shell to register a command to a request notification sent from the module and for the module to register a command for a release notification sent from the shell. Is this insane, or is that really the cleanest pure mvc approach? I feel like I'm beginning to overcomplicated what is normally simple task.
You should be handling this with Messages, not Notifications. I don't know about Fabrication, but Messages will give you strong typing and the ability to put the whole protocol into the message itself. The JunctionMediator should be able to route the message.

The task of getting data from one module to another is not always simple since you don't want to create dependencies between the modules. You need a shared protocol for communications. You can't just reach into a module and grab the data without forming a dependency - the knowledge of where and what kind of data is inside that other module.

-=Cliff>