GWT Application on App Engine--please check it out

13 views
Skip to first unread message

Daniel

unread,
Jul 21, 2008, 9:47:31 PM7/21/08
to Google Web Toolkit
If you have a minute, please check out the GWT application I just
deployed on Google's app engine, accessible at http://greatgrocerylist.appspot.com/
or at its domain http://greatgrocerylist.com/. It's free of course;
just log in with your google id.

It uses RC1 of GWT 1.5, and talks to the app engine back-end using the
GWT JSON module. The two primary user interface elements are (1) an
HTMLTable work area for the current list, and (2) a
DecoratedStackPanel which provides for navigation and configuration. I
keep the HTMLTable on the screen at all times, so secondary activities
usually occur in a modal dialog box.

The application itself is a grocery list manager. That's certainly
been done before, but I think GWT has helped me build a more-
convenient user interface. For instance, I make liberal use of the
SuggestBox and the MultiWordSuggestOracle. This lets you type "bread"
and select from a list that might have both "honey whole wheat bread"
and "Rosemary bread from the bakery."

One feature that I hope people like is the ability to copy ingredients
from your favorite web site and paste them into the application. The
app will try to parse the ingredient list into quantities and
ingredients. When you want to make this recipe, you can add it to your
current shopping list just by checking a box. (This is the kind of
client-side feature that's much easier using GWT.)

You can print out your shopping list organized by item type (produce,
condiments, dairy, etc.), or you can go the extra mile and save aisle
layouts for the stores at which you shop. You can then print your list
out in aisle-order, exactly as you would encounter the items at the
store.

I hope you find it interesting, and maybe even helpful enough to
use. :-)

-Dan O'Connor

davidroe

unread,
Jul 22, 2008, 12:09:31 AM7/22/08
to Google Web Toolkit
Looks good, thanks for sharing.

What were the interesting parts of the development process with
regards to dealing with the Google App Engine? Data persistence?
Sessions? Was is straight-forward to test in that environment?

/dave

On Jul 21, 6:47 pm, Daniel <doco...@gmail.com> wrote:
> If you have a minute, please check out the GWT application I just
> deployed on Google's app engine, accessible athttp://greatgrocerylist.appspot.com/
> or at its domainhttp://greatgrocerylist.com/. It's free of course;

Daniel

unread,
Jul 22, 2008, 8:35:24 AM7/22/08
to Google Web Toolkit
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 -

MN

unread,
Jul 22, 2008, 11:59:26 AM7/22/08
to Google Web Toolkit
nice application :-)


> There's an unobtrusive notification that appears in the UI when the
> client is communicating with the server.
but with this notification the page jumps up and down evertime it
saves something. i dont like this jumping (used with FF 2.0.16).

Daniel

unread,
Jul 22, 2008, 1:06:53 PM7/22/08
to Google Web Toolkit
Thanks for pointing that out. I'll fix it in the next release.

-Dan
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages