Basically, RF keeps 2 copies of your proxies: the immutable one you 
received from the server, and the mutable one created by 
RequestContext#edit(). Both proxies have a reference on each other (the 
immutable one using its reference to the mutable proxy as a "lock" to 
prevent creating two mutable proxies of the same immutable proxy).
When you fire() your RequestContext, RF uses AutoBeanUtils.diff() to get 
the differences between the immutable and the mutable proxy (after using 
AutoBeanUtils.getAutoBean() to retrieve the AutoBean for each proxy), and 
uses that map to build the request payload.
On the server-side, when receiving the diff, the servlet retrieves the 
entity (using its find static method or a locator) and then loops through 
the diff to call setters on the object. Note that at this time, RF works on 
the @ProxyFor-ed entity, not a proxy (a proxy is created to wrap the entity 
at a later time, to easily traverse its properties, for building the 
response).
So if you can do that swapping the client and server sides, then you're all 
done. I believe it's possible, maybe not that easy though. First, it 
implies that you keep a "cache" (on the client side) of all proxies that 
could have changes applied to them, then you need to apply those changes 
without the need to edit() the proxies (that's easy, go down to the 
AutoBean level); but you'd then (probably) have to be careful if you are 
also edit()ing a given proxy at the same time.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/mgFYhHudkb0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to