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: how to work with Proxy and big data amount ?  (Read 5294 times)
nisimjoseph
Full Member
***
Posts: 22


View Profile Email
« 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
nisimjoseph
Full Member
***
Posts: 22


View Profile Email
« Reply #2 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 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>
Logged
nisimjoseph
Full Member
***
Posts: 22


View Profile Email
« Reply #4 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 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>
Logged
nisimjoseph
Full Member
***
Posts: 22


View Profile Email
« Reply #6 on: October 05, 2008, 03:08:22 »

10x on the help
Logged
Pages: [1]
Print