*
The moose likes GWT and the fly likes GWT Applications - Questions for the author Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT Applications - Questions for the author" Watch "GWT Applications - Questions for the author" New topic
Author

GWT Applications - Questions for the author

Josh Brown
Ranch Hand

Joined: Oct 09, 2007
Posts: 35
What are the advantages and benefits of using GWT? How can it help me and others in my office to be more productive?

It would seem to me that compiling from Java to JavaScript could result in performance issues (as opposed to writing JavaScript directly). Is this an issue with GWT? On a related note, is the compiled JavaScript easy to read and tweak, if desired?

GWT sounds really interesting, and though I haven't used it yet, I'd like to get started. What sort of information/examples/etc. does your book provide that I can't find online? Feel free to convince me that I should buy your book.


Josh
Inside the Machine
Ryan Dewsbury
author
Greenhorn

Joined: Nov 07, 2007
Posts: 22
Hi Josh,

I'll try and sell you on GWT and my book.

First, are you sold on Ajax applications in general? They have the advantage of giving your users/customers a better user experience than they would get on a traditional web page (no waiting for page refreshes). They can perform better than traditional web application since they don't need to load as much data, can reduce the number of server round trips, and can move some of your application state to the browser relieving your server load somewhat. They're also easier to deploy than desktop applications with less dependencies.

Ok, now you want Ajax for your client side. If you know Java and want something that's easy to learn you should use GWT. GWT provides a library that lets you use the Java tools you're familiar with (JUnit, Eclipse, Tomcat, etc). You can also use the Java software development techniques you and your team are comfortable with.

If you already know JavaScript you may need some extra reasons to use GWT. GWT is not a code generator- it doesn't just take your Java and churn out equivalent JavaScript. GWT is a full, complex compiler. It takes your Java converts it to an abstract syntax tree (AST), optimizes the code, cuts redundant code, then converts it to a JavaScript AST and optimizes and cuts some more. The result is a very compact, and very fast JavaScript application. Faster than what you could do by hand. It would be very hard to make sweeping optimizations across an entire JavaScript code base. Also, when using JavaScript you want to maintain code readability, which sometimes contrasts with the need for performance. I've tested the Dojo mail sample and the GWT mail sample to compare performance, both of similar complexity and the load time alone was 200 ms for GWT and 6 seconds for Dojo. You should also check out this post for an example of a teams experience with GWT vs JavaScript: http://googlewebtoolkit.blogspot.com/2007/10/lombardi-blueprint-built-with-gwt.html

Ok, so now you're thinking that GWT may be pretty good. Should you buy my book? You can find a way to get started with GWT on their website. They have a few sample applications and documentation for their library. This is all I needed to get started. However I've been working with GWT for a year an a half so far and have learned quite a bit more. You need to put the toolkit documentation in context. I put the user interface library in context by overviewing it's use in many applications in ch.2. I should the many techniques of communicating with a backend using the GWT tools in ch.3. I show you software engineering techniques for GWT in ch.4. In chapter 5 I show advanced techniques on using the toolkit effectively including server performance considerations. For just this first half you get quite a bit of GWT experience in about 300 pages. The second half goes into detailed application development case studies on 5 sample applications where touch on just about every way that GWT can use a browser and interact with the web. It's a great book and it has something for every stage you're at when you learn GWT.


Hope this helps!


GWT Book - GWT Poker
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: GWT Applications - Questions for the author
 
Similar Threads
are GWT and JSF competing?
Using Struts2 + GWT
how is it useful for programmers?
GWT in Action - Does it teach from the basics ?
JavaScript knowledge - how much js is enough?