
Dmitry Buzdin
(4221) Google Web Toolkit: Real-World Experience
Technical long talk 50 min
Tuesday, 2008-06-24, 14:00 - 14:50, Arena 8
Dmitry Buzdin - C.T.Co (speaker)
Topics
Abstract
The talk presents a real-world experience gained in the development of both
Portal-based (JSR-168) and "classical" Web applications using Google
Web Toolkit technology.
* Introduction *
Google Web Toolkit (GWT) is a Java-based AJAX framework, which offers unique
approach to building Web-based Rich Interface Applications.
Instead of providing JavaScript libraries, it gives an opportunity to write
whole Web application in static typed Java language.
In the compilation process client code is translated to optimized JavaScript.
Using Java instead of JavaScript helps to develop large code base and apply
techniques such as unit testing, debugging and object-oriented design patterns
at full scale as it would be ordinary Java Fat Client application.
* Prototyping *
Before starting the first project, prototype has been built using GWT. A single
screen of the existing application was reimplemented using chosen technology,
preserving the server side code. Struts Actions and JSPs where replaced with GWT
specific client implementation.
After the prototype has been finished both versions of the screen (GWT and
Struts based) were compared.
Some of the criterias were memory consumption, network traffic, performance and
development model.
The talk gives summary of prototyping and performance testing results as well as
first impressions left by GWT.
Successuful prototyping stage showed that the technology is feasible and mature
enough to go with in a real-world project.
* Development *
GWT was chosen as a presentation layer for a portal application. The customer is
one of the leaders in Insurance business with Headquarters in Zurich city. This
was the first project for given customer with GWT technology. The project is an
application, which helps to monitor company operational information. Expected
user base is 1,500 and expected concurrent action count is 10. Application is
portal-based (JSR-168 standard).
Portlets and AJAX technologies turned out as a good match in the project. Each
portlet can be updated and redrawn individually, not refreshing the whole page
itself. Only navigation between portal pages causes browser full refresh.
Inter-portlet communication is done on the client using Message Bus Pattern
based approach.
GWT provides reusable Widgets and Asynchronous request infrastructure. The rest
is up to developers including the design of client side code.
Development of GWT client is very similar to Swing - same patterns and best
practices apply
(one of the major differences though could be that JavaScript is executed in
single thread).
Automated refactoring and unit testing support offered by modern IDEs like
IntelliJ IDEA and Eclipse is easily applicable to client code as well.
(demo is possible)
One of the features of GWT is native JavaScript support. It is possible to embed
"native" JavaScript into client code in order to do some tricks GWT
does not automate yet or o integrate with existing JavaScript library. The same
applies for HTML. It is possible to put pure HTML on the page in cases
some low-level requirements can not be done with GWT widgets.
GWT hosted mode is a tool included in GWT distribution, which allows to start-up
Web application in Java mode. In this case Java code is executed directly
without transformation. Hosted mode proved to be successful shortening build
cycles and providing debugging for JavaScript code.
(demo is possible)
Application has a single entry point for GWT (Facade pattern). GWT development
gives a chance to put part of the business logic to the browser.
The most interesting part is that it is possible to reuse single class logic
both in Java and JavaScript (for example input validation).
This helps to avoid sending a request to the server with missing mandatory
parameters. The presentation gives an overview of several GWT usage patterns.
At this part of presentation there is given a short description of project
architecture and technologies used.
It turned out that in the real-world projects one can not build successful
application without knowing underlying technologies (e.g. JavaScript and DOM)
and blindly relying on GWT. Rendering of the page is one of the aspect where
knowledge of how things work help to improve performance greatly compared
to straightforward "widget combining". The presentation gives several
simple advices on GWT code optimization approaches.
* Summary *
Experience showed that GWT is mature and stable technology platform, which helps
to achieve good results in building scalable AJAX Web applications.
All practices and experience gained in Object-Oriented world are easily
applicable to client side code as well.
The talk aims to point out the places where beginning GWT developers should
concentrate. Presentation provides a birds-eyes-view on GWT technology and its
usage patterns.






