The Google App Engine was easy to work with--and this was my first
experience with Python.
For a simple application like this, persistence was pretty simple. The
app engine datastore is closer to an object database than a relational
database--basically you just set properties on objects. If you're
familiar with the app engine, I made heavy use of entity groups and
"ancestor" queries. For instance, here's a query I used to get
GroceryListItem instances for a GroceryList (since this is a method on
GroceryList, "self" is a GroceryList instance):
groceryListItems = GroceryListItem.gql("WHERE ANCESTOR IS :1", self)
My application didn't use server session state. I stored all my
information in the browser, in a singleton that I wrote in Java and
let GWT translate. I think singletons are less of an anti-pattern in
GWT, since there are no threading issues. I used the app engine
library to handle user management--you use your Google login to
authenticate--and I think this is handled by a cookie, but I'm not
sure.
It was very easy to test in that environment. Google provides a
version of the app engine that you can run locally. I never got a
debugger up and running but I've read about other people doing it. My
server code is relatively simple, and I could add or remove a logging
statement on the fly. There's no compile necessary nor do you need to
bounce the app server.
I mentioned before that I used JSON messaging to communicate between
the client and the server. There's a "server communication" singleton,
and it makes sure only one update is sent at a time. It queues up any
data changes for which the server needs a notification, and can bundle
them all together as a single JSON message. The server can apply an
arbitrary number of changes from a single communication.
If there's an issue with a change, the client uses a "backing off"
algorithm to retry the communication (retrying several times with
longer delays between each retry). If there's a problem with
connectivity or app engine availability, the client would hopefully
eventually succeed in its update. If there's a more fundamental
problem (e.g. a coding error that keeps an update from ever working),
the client will eventually give up and display an error message.
There's an unobtrusive notification that appears in the UI when the
client is communicating with the server. Normally it's got a green
background. If for some reason it's in "backing off" mode, the
background is yellow and a hyperlink appears where the client can
learn what's going on. If the client gives up, the message gets a red
value and of course the message changes to reflect the new state.
Obviously if the user closes the browser with outstanding updates,
those changes would be lost. I give a warning message to that effect
by using a WindowCloseListener.
-Dan
> > -Dan O'Connor- Hide quoted text -
>
> - Show quoted text -