Gwit? W00t!

On the revelation that my boss had a skunk works project going to prototype a new client/server version of the user interface in Flash, I was appalled. So I suggested that he investigate Google Web Toolkit (GWT). I hadn’t actually done all that much reading about GWT, but it seemed like a really cool idea – you write both client and server side of your app in Java, test it in an Google Hosted Browser and debug it using your favourite Java debugger, and then when it’s ready, compile the client side to AJAXy Javascript.

My boss came back with a counter proposal – why don’t I investigate GWT, produce a small prototype, and he’ll evaluate it side by side with the Flash project. Of course, the person doing the Flash project has a 3 month lead on me, but hey, I’m up to a challenge.

I watched some of the videos that Google has on their site, and in spite of a slight cringe when some of the developers started calling it “gwit”, it seemed great. And then I read the docs. And joined the Google Groups group. And joined the IRC channel. And installed Eclipse and GWT on my Powerbook.

In about 4 days of working on the project, so far I have a rudimentary user interface. It calls the server which queries the database which returns an ArrayList (yes, to the Javascript side) with information about the Venues. That adds some widgets on the panel on the client.

The tricky thing I did today was I got a pseudo-server-push going. Calls to the server require a callback function which is called with the results when the server is ready. So the client calls a server method that blocks until there is an event to report, and then calls the client’s callback which processes the event and then does another call to the server method. In a real environment, the server would need to implement some sort of queue of events, but right now I’m just doing it with a simple Producer/Consumer right out of the Sun Java examples.

This GWT is exceedingly cool. I’m thinking of redoing my interfaces to use it. And I’ve started to call it “gwit”.