GWT (Google Web Toolkit)

GWT (Google Web Toolkit)

This framework has been around long enough but it is not still mentioned as one of the most used frameworks. It does bring some useful features nevertheless. Some developers have been using it for specific actions such UI components because it can be executed in the browser.

Let me introduce you to this framework as succinct as possible.

 What is GWT?

Google Web Toolkit (GWT) is a framework obviously created by Google to create rich internet applications in Java. It is a development toolkit which enables developer to develop internet or web application. GWT insists on reusable approaches to common web-app tasks such as bookmarking, UI abstraction, cross-browser portability.

The framework also provides extensive widget libraries that can perform most of the tasks making it easy for even a beginner in Java to develop business logic without worrying too much about basic stuff. One of the best features of GWT is that it converts Java code into JavaScript code – that too custom code based on the browser.

Important features

  • Developers do not need to be expert at browser incompatibilities as GWT handles through different binding.
  • GWT is a single code base for client and server.
  • it has chosen Java with which development becomes more effective as it provides code navigation, refactoring.
  • its event bus allows many updates in client-side application by placing event on the event bus.
  • It allows different Java tools to integrate with it such as hibernate through Gilead.

Components of GWT

  • GWT Java-to-JavaScript Compiler: It translates all the Java written code into JavaScript.
  • GWT Development Mode: It allows the developers to run application in development mode i.e. app run in Java without compiling JavaScript. Development mode allows native mode plug-in called Google Web Toolkit Developer Plug-in.
  • JRE emulation library: GWT includes a library that follows the Java runtime library i.e. java.lang, java.math,, java.sql, java.util etc.
  • GWT Web UI class library: For creating a widget GWT consists of set of interface and classes.

The first component is really pretty cool and useful. In fact, your Javascript code is automatically generated by GWT compiler. For a web application using AJAX and developed within this framework, you do not have to know Javascript, knowing only Java is quite enough.

However though, keep in mind that Javascript is not multithread. Only compilable features in Javascript can be used. For example, it not possible to use variable of primitive type long.

Reasons to use GWT

  • Performance Gain: In GWT with each new release of the framework developer would be able to get all new features for free. Old files gain new features by just re-compiling such as accessibility support in GWT 1.5.
  • Debugging: We can debug GWT apps just like in Java application, using IDE’s Debugger (debugging can be less of hustle).
  • UI Binder: It allows you to design and customize your widgets in an easy and less complex way using XML, HTML, and Java.
  • GWT takes a strong OO(Object Oriented) approach to Software Architecture.

GWT applications provide two modes:

  • Development Mode: It provides the facility to debug Java code of the application directly with your Java debugger.
  • Web Mode: This mode enables the application to be translated into HTML, CSS and JavaScript code which can be directly deployed to a web server.

Have I convinced you to at least take a look at this framework? If so, take a deep dive into it here:

Stephan Celestin


Laisser un commentaire