Friday, March 30, 2012

RequestFactory change/update polling

Hello,

My UI on the client needs to stay in sync with the data on the server.  I am using request factory for all of this, and it's working great.  Currently, I have a timer that fires a request to the server every X seconds to get the most recent stuff.  From what I understand of requestfactory, even though my service is providing the whole object, the requestfactory magic only sends a select number of the fields over the wire.  When the client sees a change (via a new version, and thus an EntityProxyChange event) I can call "find" on that entity (using the 'with()') to get the whole structure and update my UI.

This all works great, but now I'm thinking about how to improve efficiency on the server.  My data is rather large, and spread out over several tables.  Each time my server gets a request via that timer on the client, the server code fetches all the data and builds up the entire object structure.  Then, RF Servlet discards most of that and only puts a few fields (mainly the id and version) in the response. Is there a way I can just provide the ID and Version to the RF Servlet response?  That way I can save some computation on the server by only grabbing that from the DB, rather than the whole structure.  Then, when RF deems that there actually was a change (by comparing versions), the "find" method will be used to grab everything.

I hope my question makes sense, I'm pretty new to the RequestFactory paradigm.  It's entirely possible that I'm failing to understand something basic.

Thanks!
--Rob

--
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/-/bJ9bxavR_kIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment