PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: Karl Macklin on May 31, 2009, 03:41:16



Title: Regarding keeping model and view decoupled -Proxies should know about Mediators?
Post by: Karl Macklin on May 31, 2009, 03:41:16
I'm still learning the nuts and bolts of this framework, so maybe this is really easy.

In any case, I wonder if mediators should be allowed to know about proxies. My first personal guess would be "no, that would couple the view and model too tightly". But perhaps this is not the case. I keep seeing mediator code (in the hello flash example, and Renji an PureMVC game for example) which keeps reference to data proxies.

For example in hello flash example:
// Retrieve reference to frequently consulted Proxies
   spriteDataProxy = facade.retrieveProxy( SpriteDataProxy.NAME ) as SpriteDataProxy;

My thought seeing this was "but.. isn't that what we're trying NOT to achieve?".


Title: Re: Regarding keeping model and view decoupled -Proxies should know about Mediators?
Post by: Jason MacDonald on May 31, 2009, 08:28:10
It's fine to have mediators call Proxies for simple reads/writes. Anything more complex, or used in mutplie places, should go in a command for reuse.


Title: Re: Regarding keeping model and view decoupled -Proxies should know about Mediators?
Post by: puremvc on June 01, 2009, 06:31:52
When in doubt go back to basics:

Look at the diagram of the classic MVC pattern here:
http://en.wikipedia.org/wiki/Model-View-Controller

The Model notifies the View.
The View is notified by the Model of changes, and may update the Model directly.
The Controller is notified by the View and may update either the Model or View directly.

-=Cliff>