Google Web Toolkit-nice tool for writing Javascript

If you have ever designed a webpage using java script you would have realised how difficult it is to check for compatibility with different browsers !! also most coders like me have learnt core programming languages like C or Java and to learn Javascript just for a small work like this is a pain ! literally.

To alleviate the pain of programmers like us , Google engineers have developed the Google Web Toolkit which generates Javascript code from the  Java code written by the user.

obvious advantages  of this tool are:(As stated in google website http://code.google.com/webtoolkit/overview.html)

  • Dynamic, reusable UI components
    Create a Widget by compositing other Widgets. Lay out Widgets automatically in Panels. Send your Widget to other developers in a JAR file.
  • 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
    No, AJAX applications don’t need to break the browser’s back button. GWT lets you make your site more usable 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
    Your GWT applications automatically support IE, Firefox, Mozilla, Safari, and Opera with no browser detection or special-casing within your code in most cases.
  • JUnit integration
    GWT’s direct integration with JUnit lets you unit test both in a debugger and in a browser…and you can even unit test asynchronous RPCs.
  • Internationalization
    Easily create efficient internationalized applications and libraries.
  • 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).
  • Google API Library: Google Gears support
    We are in the process of building support for using Google APIs in GWT applications. Initially, we are providing support for Google Gears, the recently-launched developer product that extends the browser to allow developers to make web-based applications function even while offline. If you would like to download this library please visit the open source project. We are planning to add support for other Google APIs; if you’d like to help, please check out Making GWT Better.
  • Completely Open Source
    All of the code for GWT is available under the Apache 2.0 license. If you are interested in contributing, please visit Making GWT Better.

For a step-by-step installation and usage guide, please see the Getting Started Guide.

How Well Does It Work?

I think it works pretty darn well. The primary metrics we use to evaluate GWT’s effectiveness relative to traditional AJAX development are:

  • Compiler-generated JavaScript size
    GWT produces smaller JavaScript downloads for the end user than hand-written AJAX applications. In contrast to the reuse approach of traditional JavaScript libraries, the GWT compiler analyzes your source code to include only the code you actually need, and none of what you don’t.
  • End-user performance
    GWT applications are typically faster than their hand-written JavaScript equivalents, and often require far fewer HTTP round-trips. The GWT compiler avoids adding any wrappers around any functionality that is implemented natively in the browser.
  • Development time
    With so little time spent debugging problems in individual web browsers, you can spend much more of your time on application functionality. Development time efficiency is our favorite part of GWT.

    kunalghosh
    (kunal ghosh)

Leave a comment