Hot skills: Google Web Toolkit

When Bruce Johnson , co-creator of the Google Web Toolkit, boasted...

Google Web Toolkit

What is it?

When Bruce Johnson, co-creator of the Google Web Toolkit, boasted that the forthcoming version of GWT would generate better Javascript than could be produced manually, Javascript enthusiasts were very upset. But his claim gratified the far larger number of people who only use the ECMAScript-standard language because they have to.

The assertion was intended to allay the general distrust of the quality of generated code. It was also calculated to appeal to the large number of experienced Java developers who don't want to become Javascript amateurs in order to jump aboard the Ajax bandwagon.

Google says that its Web Toolkit (GWT) enables developers to write, test and debug their web applications using their own preferred Java tools and integrated development environments (IDEs). The GWT compiler converts the Java classes to reusable Javascript and HTML, which will generally work similarly on different browsers, particularly if you stick to the built-in widgets.

However, there will be limits to what you can do with the built-in components, since Google says it has concentrated on "ensuring that the basics of GWT work very well rather than adding dozens of special-purpose widgets". Having open-sourced GWT, Google expects the user community to build most of the libraries. GWT can be used royalty-free for commercial applications.

Where did it originate?

GWT was previewed at JavaOne in 2006.

What's it for?

GWT contains Javascript implementations of the most widely used classes in the Java standard class library, a set of user interface elements (widgets) that can be used to build Ajax applications, and built-in support to simplify remote procedure calls.

GWT applications are developed using the GWT hosted web browser. Applications, still in Java, run in hosted mode. Once tested, they are compiled to Javascript.

Handwritten Javascript can be added to the Java source code using the GWT's Javascript Native Interface (JSNI). Google says this powerful technique should be used sparingly. "JSNI code is less portable across browsers, more likely to leak memory, less amenable to Java tools, and hard for the compiler to optimise."

What makes it special?

Google says a typical, full-featured GWT 1.4 application involves about 100K of cacheable Javascript, in line with most hand-written Ajax applications, and will almost always be as fast as hand-written Javascript. GWT 1.5 should improve on this. GWT obfuscates the Javascript it produces, to reduce the size of the generated files. Javascript developers who want to understand their code can flag it "PRETTY", which makes it human-readable.

How difficult is it to master?

GWT builds on existing Java skills. The GWT Developer Guide should make it possible to begin to be productive within a few hours.

Where is it used?

Google claims millions of GWT downloads, but hasn't published any figures. The flagship applications are still Google's own, such as Maps and Gmail.

What systems does it run on?

Google says applications should run similarly on "most recent versions of Internet Explorer, Firefox and Safari. (Opera, too, most of the time.) DHTML user interfaces are remarkably quirky, though, so make sure to test your applications thoroughly on every browser." GWT needs recent versions of Windows, MacOSX and Linux.

What's coming up?

GWT 1.5 is due any time now.

Rates of pay

Java front-end developers with Ajax can look for £30k-40k.


GWT documentation >>

GWT, Ajax, Java and XML >>

GWT >>

GWT apps >>

Many other sites also offer GWT tutorials.


Hotskills catch-up >>

Read more on Web software