Google Web Toolkit: A Brief Review

By Angsuman Chakraborty, Gaea News Network
Wednesday, May 17, 2006

Google has released GWT - a java window toolkit which converts your java applications (using the toolkit API) to javascript (incl. AJAX) and HTML. What follows is a brief review of the features and some thoughts. But first lets see why Google thinks it is important.

Java technologies offer a productive development plaform, and with GWT, they can instantly become the basis of your AJAX development platform as well. Here are some of the benefits of developing with GWT:

  • You can use all of your favorite Java development tools (Eclipse, IntelliJ, JProfiler, JUnit) for AJAX development.
  • Static type checking in the Java language boosts productivity while reducing errors.
    Common JavaScript errors (typos, type mismatches) are easily caught at compile time rather than by users at runtime.
  • Code prompting/completion is widely available.
  • Automated Java refactoring is pretty snazzy these days.
  • Java-based OO designs are easier to communicate and understand, thus making your AJAX code base more comprehensible with less documentation.

There are several good reasons why GWT is an irrelevant technology.

Google assumes developing AJAX applications are “difficult and error prone”. That is far from reality. There are several high quality toolkits available for developing AJAX applications today like DWR (for Java), SAJAX (for PHP, Ruby etc.), prototype.js (JS Toolkit), Dojo (for effects) and dozen others.

GWT doesn’t really simplify the development life-cycle. What may be gained in developing in pure Java (assuming there is a significant gain after offsetting the learning curve, at least initially) is very likely to be offset during integration testing (post-compilation).

Most of AJAX/Javascript provide high level of transparency into the process thereby allowing you to debug any problems easily.

Transparency is something which we will be sorely missing in GWT. You have to rely on Google to deliver defect free product to base your business upon. I have used several windowing toolkits and I know how difficult it is to make them defect free. If I have to choose Java windowing toolkits my obvious preference will be swing or swt. For web applications I would rather mess with HTML and Javascript (with say Prototype or SAJAX or DWR) rather than have Google generate some thingamajig for me.

GWT machine-generates Javascript from your Java code. IMO that is a dangerous path to take. The generated code (in javascript to boot) is always very painful to debug when required. And trust me it will be required for any decent web application that does anything significant.

You can also run GWT in hosted mode. In hosted mode, your application is run as Java bytecode within the Java Virtual Machine (JVM). This is beneficial for sdevelopment. However it is obviously not a choice above plain Javascript / html interface because it requires embedding a browser control (an Internet Explorer control on Windows or a Gecko/Mozilla control on Linux) with hooks into the JVM.

The somewhat good news is GWT ships with the complete source code for the library under an open source license. However considering the nature of the beast I doubt you will gain much from going under the hood of the generator. I wish you best of luck on that.

For some strange reason the following makes me very uncomfortable:

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).

And then the privacy issue:

When you use the Google Web Toolkit’s hosted web browser, the application sends a request back to Google’s servers to check to see if you are using the most recent version of the product. As a part of this request, Google will log usage data including a timestamp of the date and time you downloaded the Google Web Toolkit and the IP address for your computer.

In conclusion I think it is a decent attempt to simplify web development and they deserve kudos for that. However I don’t think it will make much impact in web application development landscape. On a different note I am happy to see Google commitment to Java and acknowledging Java technologies offer a productive development plaform.

Discussion

Jake
September 3, 2009: 8:22 am

“You have to rely on Google to deliver defect free product to base your business upon.”

What is the difference between that and relying on a pure Javascript toolkit like prototype to be defect free?

I’m still familiarizing myself with GWT, but it sounds quite good *if* it works as advertised. It would have been nice to hear some real world experience in this review. As it stands I can’t tell whether claims such as it being an integration testing time sink have any merit.

October 28, 2008: 11:43 am

Maybe it’s too risky to depend on Google’s compiler to write JavaScript/HTML for you…

July 24, 2006: 9:32 am

[...] I would love to be able to use Java for developing YouOS applications. Maybe using Google Web Toolkit? [...]

June 13, 2006: 7:39 pm

I totally agree with you. Bad move for google, good move for Yahoo.

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :