This article is more than 1 year old

Getting Google’s Web Toolkit going

If Google can, you can too

Developers looking to build Ajax-style rich internet applications (RIA) are pretty much spoilt for choice at the moment. There are dozens of RIA tools and frameworks littering the development landscape, from those providing minimal sets of JavaScript libraries to heavyweight contenders such as Adobe’s Flex, Microsoft’s Silverlight and Google’s Web Toolkit (GWT). The Google offering, released under an Open Source licence, has quickly picked up a following by combining a wide range of useful and functional browser widgets and by using Java to drive the whole thing. Yep, that’s Java, not Javascript…

Basically GWT shields the Java programmer from the complexities of browser differences and having to learn Javascript. It means Java developers can use their existing server side or desktop development skills to create flexible, functional and rich Ajax applications (of the type popularised to a large extent by Google’s Gmail and Google Maps).

GWT In Action aims to explain to the GWT beginner how this magic is achieved and to show just what the framework is capable of. The first and most obvious point to make is that the book assumes a basic knowledge of Java. Despite what the authors would like to think, this isn’t really a book (or framework come to that), which would help if you don’t have a clue about Java. What it doesn’t assume, however, is a knowledge of GUI programming in Java, so there’s no need to sweat if you’ve never used Swing or SWT as these play no part in GWT.

The book is broadly structured into four parts, with the first part being an extended introduction that walks the reader through installation and running a sample app to creating, running and deploying your own simple application. It also discusses the Java to Javascript compiler that makes the whole thing possible, as well as touching on unit testing, debugging and IDE support in Eclipse. The next section focuses on building user interfaces, and has detailed chapters on the different widget and panels that are included in GWT, along with chapters on rolling your own. There is also a chapter on the JavaScript Native Interface (JSNI), which is the interface between Java and JavaScript and enables you to call code in one from the other.

The third part of the book moves on to more advanced topics, including RPC, interacting with JSON (JavaScript Object Notation), internationalisation and more. The final two chapters, which make up part four, look again at unit testing with Junit, deployment and a more detailed look at how GWT works under the covers. The latter chapter would have been more useful earlier in the book, but that’s a minor quibble really.

The core part of the book, which looks at building the UI, is structured around the building of a sample application – a Dashboard application which shows off both the built-in widgets and the custom widgets designed in the text. Certainly for a new developer this approach works well enough, though for those who’ve already mastered the basics there’s probably not much to be gained from this part of the book.

On the whole the book is fairly well written, though perhaps some pages could have been saved if the authors had assumed they were writing for Java developers rather than a broader audience.

GWT in Action

Verdict: A good introduction to GWT

Author: Robert Hanson and Adam Tacy

Publisher: Manning

ISBN: 1933988231

Media: Book

List Price: £35.99

Buy this book at Register Books at Reg Developer's special discounted price!

More about

TIP US OFF

Send us news


Other stories you might like