PureMVC Architects Lounge

PureMVC Manifold => Standard Version => Topic started by: eco_bach on July 20, 2009, 07:31:17



Title: Q;Correspondence of remote proxies to mediators
Post by: eco_bach on July 20, 2009, 07:31:17
I understand there are several 'right ways' to organize your classes in a PureMVC, but I'm looking for general best practices to help when initially architecting an application.
For instance, I know I will need at least 3 different remote proxies for the app I am building. A UserProxy for registration and login, an UploadImageProxy for initial image upload(from the desktop), and a CreateImageProxy to save the modified image data to the remote server.
Does this imply I will need corresponding mediators, or is the mapping of proxies to mediators arbitrary? ie in the above example I was considering the following
- a 'header' mediator that houses global items and listens to 'login' events in a corresponding 'header' view, and then retrieves and interacts with the UserProxy.
- a CreateImage mediator which interacts with (directly or via commands) BOTH the CreateImageProxy and the UserProxy since this CreateImage mediator also contains- a registration form view component.

If I were to add a publicly viewable gallery view component, would that imply a corresponding GalleryProxy(to retrieve the images) as well as a corresponding GalleryMediator?


Title: Re: Q;Correspondence of remote proxies to mediators
Post by: puremvc on July 21, 2009, 07:51:52
No, the mapping of Proxies to Mediators is entirely arbitrary. One FishProxy and one LoafProxy could feed a multitude of hungry Mediators.  ;)

-=Cliff>