PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: 99miles on September 21, 2009, 10:53:31



Title: Referencing multiple proxies from mediator???
Post by: 99miles on September 21, 2009, 10:53:31
This seems kind of bad, but I can't think of a better solution.

I have a Proxy (GetRouteProxy) that gets a route and it's mediator (GetRouteMediator) draws that route on a map.

Then another Proxy (GetBusinessesProxy) gets a bunch of results from a search that contain businesses at certain locations. The Mediator (GetBusinessesMediator) then gets these results and needs to compare the locations against the points in the route. But, this mediator doesn't have the route. So to access it, should I create a reference from within GetBusinessesMediator to GetRouteProxy to get the route? Or...?
Thanks!


Title: Re: Referencing multiple proxies from mediator???
Post by: puremvc on September 21, 2009, 01:45:41
There is no prohibition on Mediators referencing one or more Proxies. Most demos show one of the Mediator's onRegister responsibilities as retrieving references to frequently accessed Proxies.

The classic MVC meta-pattern diagram shows that the View may update the Model directly. Updates do not have to go through the Controller region, though they certainly may.

Here's a brief refresher:
http://puremvc.tv/#P100/T110

-=Cliff>