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]
Author Topic: Need help with Architecture  (Read 2102 times)
Posts: 1

View Profile Email
« on: May 30, 2012, 01:47:49 »


my query is this:
can we have two proxies that can communicate with each other? I have one proxy that talks to a remote server and receives update messages. My other proxy holds configuration data for my application. Sometimes, the first proxy receives configuration messages from the remote server that need to be passed on to the configuration proxy. how can i implement this?

Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #1 on: May 30, 2012, 07:41:21 »

Sure. If one proxy is dependent upon another proxy, just define the first proxy to take the second one as a required constructor argument. In the constructor of that first proxy, store the reference to the second one in a protected property.

You could have the first one retrieve the second one via the Facade, but there is always the possibility that will fail, if the other proxy is not yet registered. By passing the reference to the second proxy on the constructor, you ensure that it will be present as soon as it is needed, and forces you to create and register them in the right order.
« Last Edit: May 30, 2012, 07:43:48 by puremvc » Logged
Pages: [1]