Google Web Toolkit, Making AJAX development easier
Google Web Toolkit (GWT) is the new AJAX implementation provided by Google, a Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who don't speak browser quirks as a second language. Now you can develop your front end in the Java programming language and use the GWT compiler to converts your Java classes to browser-compliant JavaScript and HTML. Bret Taylor, Product Manager, posted on the Google blog :

AJAX has the power to make your site more compelling and more dynamic, but AJAX development is often complicated, with much of the development time spent working around browser quirks and the fragility of AJAX components. Trust us, we know--the development of our own AJAX apps, like Google Maps and Google Calendar, caused us no small amount of AJAX-induced frustration.That's why we're bringing you Google Web Toolkit. GWT is a new publicly available software development tool that makes creating AJAX applications much easier. With GWT, you can develop and debug your own AJAX applications in Java code using the Java development tools of your choice. When you deploy your application to production, the GWT compiler simply translates your Java application to browser-compliant JavaScript and HTML.
The development cycle with GWT :
1. Use your favorite Java IDE to write and debug an application in the Java language, using as many (or as few) GWT libraries as you find useful.
2. Use GWT's Java-to-JavaScript compiler to distill your application into a set of JavaScript and HTML files that you can serve with any web server.
3. Confirm that your application works in each browser that you want to support, which usually takes no additional work.
I find the idea of a GWT compiler very interesting since for Java developers the development will be much more easy compared to Javascript development which is more difficult and require more time to finalize your application. Wondering if the release of GWT is an answer to the YUI or a way that google is choosing to let more users try their development tools and give feedback to make it better. I'm sure that the experience of Yahoo! with their proprietary Yscript wasn't good, things that makes Yahoo! look for alternative scripting language such PHP, and make the decision of working with open source more easy to take. In the other side Google was very open since its beginning but open sourcing their projects in this way wasn't in their strategic plans, since most of the project released are related to APIs based on the different google services.
Also we know that Google is one of the first members announced in the Open AJAX project, so maybe this motivated the release of a GWT, in addition that Google have a great experience with RIA in their products such Google reader, Gmail, Google Maps, Google Calendar ... etc.
Google Web Toolkit have many interesting features :
* Dynamic, reusable UI components : the widget-based architecture provide a great flexibility to create new components, merge and share.
* Really simple RPC : To communicate from your web application to your web server, you just need to define serializable Java classes for your request and response. In production, GWT automatically serializes the request and deserializes the response from the server. GWT's RPC mechanism can even handle polymorphic class hierarchies, and you can throw exceptions across the wire.
* Browser history management : a focus on usability to not break the back button, GWT provide this possibility by easily adding state to the browser's back button history.
* Real debugging : In production, your code is compiled to JavaScript, but at development time it runs in the Java virtual machine. That means when your code performs an action like handling a mouse event, you get full-featured Java debugging, with exceptions and the advanced debugging features of IDEs like Eclipse.
* Browser compatible : GWT applications automatically support IE, Firefox, Mozilla, Safari, and Opera with no browser detection or special-casing within your code in most cases.
* Interoperability and fine-grained control :If GWT's class library doesn't meet your needs, you can mix handwritten JavaScript in your Java source code using our JavaScript Native Interface (JSNI).
Currently there is many example project built with GWT from hello world, Dynamic table, desktop clone, JSON RPC, Kitchen Sink; and showing some of the most common features you can use with GWT. Google Web Toolkit is released under an Apache License, Version 2.0, and download is available for both Windows XP/2000 (13.9 MB) and Linux (GTK+ 2.2.1+) (23.9 MB).
For more information http://code.google.com/webtoolkit/


Subscribe to AJAX Magazine's feed