JSON told me the answer

Google Web Toolkit Applications by Ryan Dewsbury

I picked this book up in Cambridge library, and it was a fantastic read. I keep coming across toolkits that translate languages into javascript in order to make it easy to write applications that run in a browser on the client. Tools for F# and Clojure are two that I have recently come across. This book covers what looks like the most complete toolkit of them all, the Google Web Toolkit which uses Java as the source language.

The book’s introduction makes a good argument as to why this kind of technology is really useful – Ajax applications are easy to deploy, without the need to have any kind of plug-in installed in the client, into browsers which are now standards compliant enough to generate pretty rich user experiences. GWT allows Java skills, and the usual Java development environments such as Eclipse, to be used in the development of these kinds of applications.

The first section of the book provides a good introduction to the GWT. It covers the user interface elements and layouts, describing how they can be customised using CSS and extended by hooking into user defined javascript functions, how events are handled, how communication can happen with the server using the GWT RPC mechanisms and other techniques for fetching data. It moves on to a detailed account of how to get the toolkit running inside Eclipse and how the final application can be debugged using the toolkit’s built-in browser and then deployed as a standalone application.

The second section of the book, rich web applications by example, shows the development of five applications using the GWT. These range from a simple Gadget Desktop which demonstrates the various layouts and how to implement drag and drop, to an instant messenger application. This second section shows a number of interesting techniques that I hadn’t seen before. The first, was fetching data from sites that would normally be blocked by the browser’s same origin check, by having the data fetched using a script tag which would fetch javascript that would execute a given callback function with the fetched data. The second was avoiding polling for events by having the client call into the server which would potentially block for up to 30 seconds, at which point it would return and the client would then reissue the call. This can be made quite scalable, as long as the server can handle the messages without using a thread per call, which is shown to be achievable in a number of web servers such as jetty.

A really good introduction to a technology that I would like to find time to explore in the future.

This entry was posted in Books. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s