Thanks for your input - much appreciated! I had actually come to the same conclusion after posting this when I was thinking about alternative solutions to the issue.
Regarding accessing results of a callback elsewhere in the application (if required), what is the best way to do this?
Cheers
Tim
On Thursday, 18 April 2013 20:27:39 UTC+1, Jens wrote:
-- On Thursday, 18 April 2013 20:27:39 UTC+1, Jens wrote:
As its a mobile app you should always think about how to reduce server requests by sending the server more information at once. Less requests => less latency in using your app.For example the above 4 steps you have described can be done with a single request:Request: Client logs in: Client sends credentials AND current DB version (0 = no DB yet)Response: If credentials are valid, the server sends back SQL based on the client db version (either full schema or just an upgrade or nothing at all). If credentials are invalid, an HTTP error code will be send.In the very rare cases where you really need to wait for a server response before you can immediately (without user interaction required) fire the next server request just use private methods to "flatten" the daisy chaining a bit:server.fetchFirstThing(new AsyncCallback() {void onSuccess() {fetchSecondThing();}}But as mentioned, if no user interaction is required between requests, there is a good chance that you can combine these requests into a single one.-- J.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment