When to use EntityProxy vs. ValueProxy

341 views
Skip to first unread message

Yan

unread,
Jul 18, 2012, 10:45:05 AM7/18/12
to google-we...@googlegroups.com
Hi there,

I have a parent class and child class. Child class has a lot of data. The parent contains a list of child objects.  Child is never loaded/updated by themselves, they are always maintained when user reads/updates on a parent.

The question, Parent makes a natural fit for EntityProxy. Because I want to take advantage of GWT client only send delta to server, I think Child should be another EntityProxy (not ValueProxy). Is that correct?

Is this a good determination when to use ValueProxy vs. EntityProxy: whether GWT client sends only delta or the whole serialized object to server?

Thanks,
Yan

Thomas Broyer

unread,
Jul 18, 2012, 12:44:11 PM7/18/12
to google-we...@googlegroups.com
The main difference between EntityProxy and ValueProxy is that EntityProxy have an "identity": there's an ID that can be used to map to a given "entity" on the server. This is what enables the use of deltas (because you can retrieve the entity the diff should be applied to) but that's a bonus feature, not a "discriminator".
In other words: to be able to benefit from "deltas", your data must first be "identifiable". If that's the case, then you have the choice of EntityProxy vs. ValueProxy (and I'd rather go for EntityProxy). Otherwise, you have no choice but using ValueProxy.
Reply all
Reply to author
Forward
0 new messages