InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

GWT 2.0 Milestone 1 Released

Posted by Dionysios G. Synodinos on Oct 06, 2009

Sections
Development
Topics
Rich Internet Apps ,
Java
Tags
GWT

The Google Web Toolkit team has announced the release of milestone 1 of the new version of GWT.  This version includes several new features and bug fixes.

Amit Manjhi explains that there are some changes in this version that might confuse users that are already familiar with the older version of GWT:

* Terminology changes: We're going to start using the term
"development mode" rather than the old term "hosted mode." The term
"hosted mode" was sometimes confusing to people, so we'll be using the
more descriptive term from now on. For similar reasons, we'll be using
the term "production mode" rather than "web mode" when referring to
compiled script.

* Changes to the distribution: Note that there's only one download,
and it's no longer platform-specific. You download the same zip file
for every development platform. This is made possible by the new
plugin approach used to implement development mode (see below). The
distribution file does not include the browser plugins themselves;
those are downloaded separately the first time you use development
mode in a browser that doesn't have the plugin installed. can be downloaded from Google Code, but as all milestone builds it is not recommend for production use.

Amit also describes the new features of GWT v2:

* In-Browser Development Mode: Prior to 2.0, GWT hosted mode provided
a special-purpose "hosted browser" to debug your GWT code. In 2.0, the
web page being debugged is viewed within a regular-old browser.
Development mode is supported through the use of a native-code plugin
for each browser. In other words, you can use development mode
directly from Safari, Firefox, IE, and Chrome.

* Code Splitting: Developer-guided code splitting allows you to chunk
your GWT code into multiple fragments for faster startup. Imagine
having to download a whole movie before being able to watch it. Well,
that's what you have to do with most Ajax apps these days -- download
the whole thing before using it. With code splitting, you can arrange
to load just the minimum script needed to get the application running
and the user interacting, while the rest of the app is downloaded as
needed.

* Declarative User Interface: GWT's UiBinder now allows you to create
user interfaces mostly declaratively. Previously, widgets had to be
created and assembled programmatically, requiring lots of code. Now,
you can use XML to declare your UI, making the code more readable,
easier to maintain, and faster to develop. The Mail sample has been
updated to use the new declarative UI.

* Bundling of resources (ClientBundle): GWT has shipped with
ImageBundles since GWT v1.4, giving developers automatic spriting of
images. ClientBundle generalizes this technique, bringing the power of
combining and optimizing resources into one download to things like
text files, CSS, and XML. This means fewer network round trips, which
in turn can decrease application latency -- especially on mobile
applications.

* Using HtmlUnit for running GWT tests: GWT 2.0 no longer uses SWT or
the old mozilla code (on linux) to run GWT tests. Instead, it uses
HtmlUnit as the built-in browser. HtmlUnit is 100% Java. This means
there is a single GWT distribution for linux, mac, and windows, and
debugging GWT Tests in development mode can be done entirely in a Java
debugger.

UiBinder which was recently moved to GWT’s trunk and generates Widget and DOM structures from XML markup, aims to provide an easier declarative way to create UIs:

A simple widget-based UI

<!-- HelloWidgetWorld.ui.xml -->

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:g='urn:import:com.google.gwt.user.client.ui'>
  <g:HTMLPanel>
    Hello, <g:ListBox ui:field='listBox'/>.
  </g:HTMLPanel>
</ui:UiBinder>

public class HelloWidgetWorld extends Composite {

  interface MyUiBinder extends UiBinder<Widget, HelloWidgetWorld> {}
  private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);

  @UiField ListBox listBox;

  public HelloWidgetWorld(String... names) {
    // sets listBox
    initWidget(uiBinder.createAndBindUi(this));
    for (String name : names) { listBox.addItem(name); }
  }
}

// Use:

HelloWidgetWorld helloWorld =
  new HelloWidgetWorld("able", "baker", "charlie");

It seems that older GWT applications will not require significant amount of effort to be ported to the new version:

Breaking changes
* The way arguments are passed to the GWT testing infrastructure has
been revamped. There is now a consistent syntax to support arbitrary
"runstyles", including user-written with no changes to GWT.  Though
this does not affect common launch configs, some of the less common
ones will need to be updated. For example, '-selenium FF3' has become
'-runStyle selenium:FF3'

You can find more information about the Google Web Toolkit, right here at InfoQ!

Dionysios G. Synodinos is a Web Engineer and a freelance consultant, focusing on Web technologies

Sounds really great, especially the multitime downloaded function by Wang Simon Posted
  1. Back to top

    Sounds really great, especially the multitime downloaded function

    by Wang Simon

    #, It will leverage the client side pressure

Educational Content

Jesper Boeg on Priming Kanban

In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.