Home > Essay examples > Develop Large-Scale Apps with Google Web Toolkit (GWT)

Essay: Develop Large-Scale Apps with Google Web Toolkit (GWT)

Essay details and download:

  • Subject area(s): Essay examples
  • Reading time: 3 minutes
  • Price: Free download
  • Published: 15 May 2019*
  • Last Modified: 23 July 2024
  • File format: Text
  • Words: 854 (approx)
  • Number of pages: 4 (approx)
  • Tags: Google essays

Text preview of this essay:

This page of the essay has 854 words.



Google Web Toolkit (GWT) is an open source web development framework that allows developers to build large scale and high performance web application while keeping them as easy-to-maintain. With Google Web Toolkit, we are able to write front end in Java, and it compiles our source code into highly optimized, browser-compliant JavaScript and HTML.

Browsers are capable of a lot these days, but to take full advantage of the browser you need to be an expert in JavaScript and three or more browsers and their quircks, and potentially have a lot of time on your hands. Alternatively, you could have a good set of tools to help you out.

Google Web Toolkit provides a set of tools for just that. It lets a developer write an AJAX application in the Java programming language, taking advantage of all the tools available for Java, and than cross-compiles that code into highly optimized, plain old JavaScript. JavaScript that's not only optimized per browser, but can be served from any web server.

The source package structure is divided into client and server packages. At deploy time, Java files in the client directory will be cross-compiled into JavaScript, and run in our users browsers. Files in the server directory will be run as bytecode on the server. Because the client code is also modeled in Java, we have the option of using the same objects across both my server and my JavaScript client.

Google Web Tootkit provides higher-level abstraction on top of JavaScript, enabling developers to be more productive by coding against widgets and events that works across all major browsers. It's worth noting that we can also mix handwritten JavaScript into Google Web Toolkit source code easily.

Part of the development-time magic on Google Web Toolkit is the hosted mode browser. During development, we interact with our application in the hosted mode browser, which runs our Java byte-code on the back-end to render our user interface in an embedded browser.

This has two benefits. First, because we're running Java byte-code, it means we can debug as we would any Java applications, setting breakpoints, inspecting variables, and stepping through code. Second, we can develop using the familiar edit-refresh-view programming model of JavaScript. We don't have to compile our Java source into JavaScript to see changes in the browser.

Google Web Toolkit provides an optimized RPC mechanism for Java, which means we don't have to worry about the complexity of low-level HTTP interactions. Alternatively, we can also use easily JSON to communicate with the server.

When we are ready to see what our application will look like in production, we compile our source code into JavaScript. Google Web Toolkit handles the browser implementation differences for us, and creates an optimized JavaScript file per major browser. The code is contained in the cache.html files. Browser-specific JavaScript means a user downloads only what they need. An Internet Explorer user doesn't download code needed for Firefox.

The compiled script is heavily optimized, including compiler optimizations like method in-lining, code size reduction, such as removal of comments and unused code, and of course, the final script is obfuscated and minified. If we want to inspect the final JavaScript in a human-readable form, simply compile with the ‘pretty’ option selected. Just be sure to switch back to obfuscated before deploying, as this results in faster code and less JavaScript for the user to download.

Advantages of Google Web Toolkit

The learning curve is very slow for a Java developer;

Debugging it's as easy as debugging any pure Java applications

Developing Google Web Toolkit is quick thanks to error checking and syntax highlighting

Easy to manage client history that means that Google Web Toolkit provides back button support

We can use both JUnit and Mockito for unit testing. Google Web Toolkit makes very easy to apply TDD (Test-driven development) or BDD (Behavior-driven development) patterns.

Google Web Toolkit provides cross-browser support that means that our application will work similarly on the most recent versions of IE, Firefox, Chrome and Safari.

The UI Binder framework is an excellent tool to build our applications as HTML pages with Google Web Toolkit widgets sprinkled throughout them

Exchange Java object over HTTP between our client and server, it is straightforward using the Google Web Toolkit RPC framework

Disadvantages of Google Web Toolkit

Main Google recent projects are not longer developed with Google Web Toolkit

Used to have a good community behind but it is decreasing quickly

There is too much boilerplate code. Creating a simple table in Google Web Toolkit  could take you more than a hundred lines.

Google Web Toolkit is only useful for Java developers, if we are coming from a different background I don't think Google Web Toolkit will be helpful for us

UI test are too slow. Although, if you apply correctly the Model-View-Presenter design pattern, you could minimize the use of GWTTestCase, and write fast JRE tests

The compilation time from Java to JavaScript is very slow. This is my main problem with Google Web Toolkit; I found that the Google Web Toolkit compiler performance is lousy.

Discover more:

About this essay:

If you use part of this page in your own work, you need to provide a citation, as follows:

Essay Sauce, Develop Large-Scale Apps with Google Web Toolkit (GWT). Available from:<https://www.essaysauce.com/essay-examples/essay-2017-06-26-000d8q/> [Accessed 03-10-24].

These Essay examples have been submitted to us by students in order to help you with your studies.

* This essay may have been previously published on EssaySauce.com and/or Essay.uk.com at an earlier date than indicated.

NB: Our essay examples category includes User Generated Content which may not have yet been reviewed. If you find content which you believe we need to review in this section, please do email us: essaysauce77 AT gmail.com.