PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: dbasch on March 12, 2008, 04:50:16

Title: Proxy granularity
Post by: dbasch on March 12, 2008, 04:50:16
Is it good practice to have a Remote (asynchronous) Proxy manage a large Data Object and expose functions to manipulate that large Data Object?

Or, is it better to dynamically register new Remote Proxy Objects with the facade that manage a subset of that large Data Object?

For instance, say I have a large Data Object that represents all of the students in a classroom. Every student has their own large Data Object representing the scores of every test they have ever taken, their address, their favorite color, etc, etc... The teacher wants to be able to retrieve the Data Object for several students simultaneously.

Should every student have their own Student Remote Proxy Object instance that is created when they enter the classroom?

Or, should their be only one Classroom Remote Proxy that has a searchStudents() function?

Kind of a silly question but I would love to hear everyone's opinions.

Derek Basch

Title: Re: Proxy granularity
Post by: dbasch on March 12, 2008, 09:35:04
I think I found the answers to my questions in this thread:

A question about Proxy Classes
http://forums.puremvc.org/index.php?topic=16.0 (http://forums.puremvc.org/index.php?topic=16.0)

It addressed the root of my question perfectly ;D

The Implementation Idioms and Best Practices is a great document and I can almost always find the answers to my question within it. However, as 'carl' noted in the referenced thread, the usage intent for Proxies is a bit ambiguous.  IMHO, the answer from Cliff in that thread should be added to the Implementation Idioms and Best Practices document. Very useful stuff indeed.