PureMVC Architects Lounge

Announcements and General Discussion => Getting Started => Topic started by: cddin on July 25, 2008, 04:31:44



Title: proxy and VO (basic)
Post by: cddin on July 25, 2008, 04:31:44
hi, I have a question regarding VO. Just to make sure my understanding regarding proxy n vo is right..

I want to create VO that store all basic configuration(stage height, fps, and another info). and I want to make sure there is only one instance of this VO object.. (singleton)

can I make it singleton?

but.. if any component want to show the data.. it will duplicate the VO and store locally in the component(another instance of VO).. so the cmponent will show the data from its local data(similar to dataprovider in flex component).. not direct from VO.. so I think I cannot make the VO singleton..

is my understanding correct?

if user try to edit data from component(ex. form panel).. the component will update the data locally n will sent notification so the proxy will help to update VO..

am I right?



Title: Re: proxy and VO (basic)
Post by: puremvc on July 26, 2008, 04:51:14
Please examine the EmployeeAdmin demo. I believe you will see a similar use case implemented.

When you select an employee in the table the editing panel will get the data in the form of a VO. You can edit the data, and cancel or submit your change if you submit, the VO is updated and the changes are reflected in the table, otherwise they are discarded.

And, you probably don't need to make the VO or the Proxy a Singleton. Since we use a NAME constant to register a Proxy, only one can be registered in that name. You have to provide a unique instance name to registerProxy if you want more than one in the system.

-=Cliff>


Title: Re: proxy and VO (basic)
Post by: cddin on July 26, 2008, 05:41:11
haa.. I see.. after submit the data, proxy will update VO n then will send notification n update the view component.. ok now I clear.

thanks