aspose file tools*
The moose likes GWT and the fly likes Very General GWT Question for authors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "Very General GWT Question for authors" Watch "Very General GWT Question for authors" New topic
Author

Very General GWT Question for authors

Mike Firkser
Ranch Hand

Joined: Oct 21, 2003
Posts: 247

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.


Mike Firkser
Rutgers '84
Adam Tacy
author
Ranch Hand

Joined: Jun 02, 2007
Posts: 37
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:

http://dashboard.manning-sandbox.com.

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");
fp.add(label);
fp.add(b1);
RootPanel.get("SomeDOMElement").add(fp);

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)

.gwt-Button{
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 )

//Adam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Very General GWT Question for authors
 
Similar Threads
Welcome to the GWT Forum!
TDD or BDD and GWT?
[GWT Java AJAX Programming] Book Comparison
GWT, Maven 2, Eclipse, Spring, Hibernate advice
Questions about the future of JSF (comparing with GWT, JavaFX)