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

Pages: [1]
Print
Author Topic: Retrieving data from outside of a module in a multicore application  (Read 6372 times)
bigTimeOperator
Newbie
*
Posts: 6


View Profile Email
« 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.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
« Last Edit: May 21, 2010, 10:54:23 by puremvc » Logged
Pages: [1]
Print