PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: eco_bach on July 11, 2009, 11:56:11



Title: recommended mappings of commands to proxys
Post by: eco_bach on July 11, 2009, 11:56:11
Right now I have just one  command with a switch case statement handling all my communication from several mediators to one Proxy.

But I am refactoring to have separate proxies for each type of data I am dealing with.

I assume then that my single command must be split up, one command per proxy since each command only knows about one proxy.
Is this a recommended best practive?


Title: Re: recommended mappings of commands to proxys
Post by: puremvc on July 13, 2009, 07:51:18
You don't have to route all communication with proxies through commands. Mediators are allowed to retrieve and communicate with proxies, and in fact generally retrieve and keep local references to frequently used proxies. You only really need to go through a command if you're going to get some reuse out of it, such as when several mediators all call the same method  on a given proxyl.

-=Cliff>