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+unsubscr...@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.


Reply via email to