• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Very General GWT Question for authors

Ranch Hand
Posts: 249
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As the IT field seems to have a new buzzword or "latest thing" come out like clockwork, I will throw humility and pride to the side and ask:

1) In general terms, what is GWT?

2) What are its uses?

3) What kind of learning curve is there?

That's it for now.

Thanks to the authors for this opportunity. When I find out about new (at least new to me) technologies, I think it's best to hear from experts.
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike,

To answer your questions (at least from my viewpoint)

1) In general terms, what is GWT?

GWT allows you to use the power of Java tooling (IDEs, Ant, JUnit, Maven etc etc) as well as harnessing the Java language benefits (native OO, strong typing model etc) to build applications that run as JavaScript,
consistently, across a wide range of web browsers, as well as being able to communicate with a wide range of server side technologies.

At a really high level, which does no real justice to GWT, you write your application in Java, the compiler converts that to several JavaScript permutations that can be loaded into a web browser via a small piece of bootstrapping code.

An example application can be seen here:


There is only one code base for this application, yet it runs consistently across Safari, Opera, IE6, Firefox etc. The written code does not need to worry about all the differences in DOM or using the XMLHttpRequest object (for AJAX calls).

2) What are its uses?

For me the uses are for building more complex web applications where you really want to focus on business logic rather than coping with browser issues.

Yes you can do this in JavaScript using other frameworks, but as mentioned above, GWT's big benefit is you get access to all the existing Java tools and language constructs for free in your development processes.

For small applications, GWT could be seen to be overkill if you have a great JavaScript development team, but the bigger you get, the more valid something like GWT becomes.

As web application development starts maturing, we need to start thinking of through life costs and maintainability etc; GWT is well placed to support all that.

3) What kind of learning curve is there?

It really depends on where you start from... If you know Java and have an appreciation of JavaScript/AJAX limitations then you should be up and running pretty quickly (in fact it should take no more than about 10 minutes to create your first example application).

A simple sample of code to display a label with a Button HorizontalPanel is below to give you an idea of what it looks like from a Java perspective:

HorizontalPanel fp = new HorizontalPanel();
Button b1 = new Button("OK");
b1.addClickListener(new ClickListener(){
public void onClick(Widget sender){
Window.alert("I got clicked");
Label label = new Label("Some Text");

To get more from GWT an appreciation of the DOM and Cascading Style Sheets and the cross over from pure Swing to a more web standards based way of thinking would be useful. So to style the button, you could write (each widget comes with a default style class, which you can change)

font-family: Helvetica;
color: green;

I don't think there is too steep a learning curve, there are a number of things that can catch you out, especially as it is sometimes hard to remember when writing in Java that your program will run in JavaScript on a webbrowser.

The easiest thing to do is just download GWT and give it a while (of course with GWT In Action as your guide )

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic