PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: nisimjoseph on October 02, 2008, 07:07:43



Title: how to work with Proxy and big data amount ?
Post by: nisimjoseph on October 02, 2008, 07:07:43
hello,

i have a Proxy question. i have one function on the server that give me most of the data in JSON. i don't want 1 proxy to have the all data in one object. right now i can't cut it to some server functions.
how can i get the data and separate it to some proxies and not to only one ? should i use a delegate ? and if so, how it come to this picture here ?

10x,
Nisim


Title: Re: how to work with Proxy and big data amount ?
Post by: puremvc on October 02, 2008, 09:41:47
Hierarchies often exist in both the view and the model.

Just as a Mediator will often create and register Mediators for the children of its view component, a Proxy may create and register Proxies for parts of its data object.

-=Cliff>


Title: Re: how to work with Proxy and big data amount ?
Post by: nisimjoseph on October 02, 2008, 11:35:44
ok, that i know.
but when i has SubDataProxy, for instance, that call to MainDataProxy and the Sub ask the Main to get the data and want to know about this. how he can know it, he doesn't notify for notifications that sent in the app. and the data form the server can come after some time. so he just call the Main and forget about it.

Nisim


Title: Re: how to work with Proxy and big data amount ?
Post by: puremvc on October 02, 2008, 11:43:18
The SubDataProxy asks the MainDataProxy to get the data by retrieving it and calling a method on it.

The MainDataProxy should, upon receiving the data, retrieve the SubDataProxy and set the data on it. Then the SubDataProxy sends the notification to the rest of the app that the data is present.

-=Cliff>


Title: Re: how to work with Proxy and big data amount ?
Post by: nisimjoseph on October 02, 2008, 12:16:39
10x on the answer.
i thought so. i will do it in that way or with callback functions. i don't want that the MainProxy will set the data or even know the SubProxy's.

thank you for the help.

BTW, great documentation it really explain it all.
Nisim


Title: Re: how to work with Proxy and big data amount ?
Post by: puremvc on October 03, 2008, 09:03:39
Yes in that case you are moving toward the Proxy as Delegate scenario, which was discussed in another thread here recently.

It certainly has merit since it decouples the two Proxies in the right direction. Its acceptable for the SubProxy to know the MainProxy, but since many Proxies may know the MainProxy, its best for it not to need to know them all.

-=Cliff>


Title: Re: how to work with Proxy and big data amount ?
Post by: nisimjoseph on October 05, 2008, 03:08:22
10x on the help