Search This Blog

Thursday, December 6, 2007

The Google Widget Toolkit's AJAX Recipe: Less JavaScript, More Speed

In this article, the co-creator of the Google Widget Toolkit (GWT)
explains how his team plans to release a GWT version that compiles
faster AJAX code than a JavaScript expert could write by hand. In a
media briefing at the conference, Google Engineering Manager and GWT
co-creator Bruce Johnson explained the mission his team undertook
when Google open sourced GWT under the Apache 2 license in December
2006: create a better user experience by enabling Java developers to
create high-performance web applications using only the Java tools
they know rather than trying to master the JavaScript skills that are
necessary for creating responsive web interfaces for all the browsers
out there. "The average usability of web sites sucks," he said, citing
all-too-familiar examples of web user headaches [...] GWT's goal is
to free Java developers from having to make that choice by taking the
client-side scripting out of their hands. GWT is composed of two
components: an AJAX widget library and a cross-browser compiler that
converts Java code into AJAX. Java developers can use each component
independently if they choose to, but they don't have to write a single
line of JavaScript code by hand. When asked to differentiate GWT from
other freely available AJAX toolkits and frameworks such as Dojo,
Prototype, and jQuery, Johnson emphasized Google's commitment to
making AJAX faster and smaller (i.e., containing less JavaScript code).
The GWT team uses a benchmarking subsystem to measure the performance
of its compiled code for any given browser permutation, which enables
them to "optimize like crazy." The result is an application like GWT
mail sample, which Johnson cited for its speed. When GWT 1.5 arrives,
Johnson said it will also offer full language support for Java 1.5
(Generics, etc.). This feature would enhance the current 1.4 version's
features, notably AJAX internationalization, which uses message
templates to enable developers to compile code for 400 locales from
one code base, and browser history support.

No comments: