puremvc
|
|
« Reply #1 on: February 22, 2010, 10:13:45 » |
|
Proxies and Mediators can be dynamically named allowing you to have more than one instance. As long as the name you pass to the super class constructor is unique, you're set. The idiom of using a NAME constant is for the 90+% of Mediators and Proxies that only ever need a single instance.
As far as nested data goes, the data object of a Proxy can be a complex object or a collection of such. If the Proxy needs to expose methods to work with parts of the data, it can do so, but can become a little chunky if it has lots of methods. At which point I often create other proxies for the sub-objects and have the proxy for the master object register the sub object proxies with its reference to them. This is the same as how a Mediator for a complex object may register other mediators for its view component's children.
-=Cliff>
|