Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: proxy and VO (basic)  (Read 7958 times)
cddin
Newbie
*
Posts: 8


View Profile Email
« 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?

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
cddin
Newbie
*
Posts: 8


View Profile Email
« Reply #2 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
Logged
Pages: [1]
Print