Brian - thanks for the detailed questions. Your questions, and Thomas'
replies, have made me understand RequestFactory much better than I did
before. I was also curious about why EntityProxies had associations with
RequestContexts in some cases but not others.
On 2012/05/17 12:59:25, tbroyer wrote:
On 2012/05/15 19:31:41, skybrian wrote:
> More naive questions:
>
> It seems like instead of having EntityProxy.equals() work in two
different
ways,
> we should inline AutoBeanUtils.diff() and simplify it to do exactly
what we
want
> for this case, without relying on Object.equals() if possible? We
don't care
> what the diffs are and can return early as soon as we find one, so
> AutoBeanUtils.diff() does too much work in any case. (And maybe we
can order
the
> comparisons to do the cheap ones first?)
I guess we could do it yes, though I'm nor sure it's that easy (re.
collections
and ValueProxies).
It'd be more of an optimization thing (and AutoBeanUtils can be
probably be
optimized a bit too) so how about simply adding a TODO for now? (as
I'm not sure
that alternative will be done in time for 2.5)
> This would get rid of the "diffing" flag and the spooky action at a
distance
> based on a magic flag.
If we can get rid of the diffing flag by changing the implementation of
AutoBeanUtils.diff, I'd be in favor of that. I'd be ok with filing
another bug for this, referencing it in a comment, and marking the new
bug post-2.5 (in the interests of time).
>
> I also wonder if the equals() check is just a mistake. The beginning
of
> AutoBeansUtils.diff() looks like this:
>
> // Fast check for comparing an object to itself
> if (a.equals(b)) {
> return Collections.emptyMap();
> }
>
> If we wanted a "fast check", shouldn't this be a==b, not
a.equals(b)? I
suppose
> it was written assuming that a Category wouldn't be used to override
equals().
That's not our issue here (equals() is used when comparing property
values), but
yes, I suppose that one's a mistake (and note that sameOrEquals uses
==).
If this is a mistake, might as well fix it in this CL.
http://gwt-code-reviews.appspot.com/1601806/
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors