puremvc
|
|
« Reply #1 on: January 05, 2009, 06:50:18 » |
|
Hi Eugene,
First, if you want to create a LanguageProxy that sounds fine. It could also be an enum that is just a property of a larger set of configuration. See the EmployeeAdmin demo for the use of enums.
As for the public properties / accessors on proxies, there's no problem with that, though the proxy shouldn't itself become a bag for a ton of different props. That leads to the urge to bind to it (in flex) or otherwise make it available to view components. Rather the proxy should ideally be on charge of a VO which could be passed across tiers without making couplings to system actors.
The data property that exists in a Proxy is similar to the viewComponent property of the Mediator. It should hold an object or collection that the proxy tends, and that should be the extent of the data held by the Proxy. You should usually write a typed getter that returns that data object cast to the proper type. For instance the LanguageProxy might return a LanguageEnum.
It might just as easily be the case that you have a PrefsProxy that returns a PrefsVO that has a LanguageEnum as its language property. This might be preferable since you'll likely have other preferences info that may be used in the same places in the app that language is, and thus would reduce the number of proxies that have to be retrieved to apply the preferences to the view.
-=Cliff>
|