GWT is cool, but not complete

These observations are based upon my past 3 month’s experience with GWT. If you are new to GWT check the site here. The very idea of building your AJAX applications in Java is very enticing and GWT team has done good job of providing a way to do it using GWT. Let’s dive into things that matters to you if you want to go for GWT.

Precautions: It looks like Java and feels like Java. This picture may lure you to think that you can do everything in GWT that you can do in Java. It is not true. You need to keep in mind that you can only do things in GWT that you can do with JavaScript and HTML. You build your UI using GWT widgets. You feel at home with the API, if you are familiar with Swings. For each widget GWT generates equivalent HTML element and Java Script for processing.You should make sources of all the Java classes, you use in GWT, available to compiler. Your processing code should be Java 1.4 compatible and you have to forget about multi threads and other features that are not supported in Java Script. If you have already gone through GWT documentation, you would have known GWT provides a way to embed Java Script inside the Java code using JSNI. As I said, although you write code in Java you have to keep Java Script supported features in mind. If you are a starter, you better look into examples provided in GWT site. The documentation is adequate.

There is a huge advantage when it comes to debugging. Because it is (like) Java, you can use any of your existing Java tools for development.

Widgets: This is the area where I was really disappointed. The widgets that come with GWT are really minimum. This caused my initial resistance going towards GWT. All you get is raw widgets and they look a bit ugly (You can change the look of the widgets by injecting CSS styles). No built in data binding and validation for widgets, viewers, drag and drop etc. You need to build everything on your own. There are third party libraries available for features like drag and drop, effects, viewers etc. By default, GWT should have provided lot of UI components that any RIA framework or tool set provides. For example, like Flex,Echo 2, Ext etc. There are efforts to make situation better. Check the resource section for GWT libraries and examples.

Server communication: GWT provides two options for you client side code to communicate with server. One is using pure JSON over HTTP and, second one is using RPC. The RPC mechanism abstracts you from the nonsense of dealing with marshaling and unmarshaling of JSON. You can deal with pure Java objects. There is a caveat here, which I will discuss in next paragraph. Here again, if you want to communicate with server using SOAP XML messages or some other form of communication, you are left on your own. This is not a show stopper or something of that sort. But when you look at Flex or Open Laszlo, you desire for that in GWT.

With GWT-RPC, your code should be Java 1.4 compatible(I heard GWT team is working towards brining Java 5 compatibility to GWT). If your domain objects uses Java 5 features like generics, annotations, you can not reuse the same domain objects as value objects. Then, you need to introduce some conversion mechanism here.

Even if your code domain objects are Java 1.4 compatible, you need GWT specific XML file in your domain objects source package.

And GWT-RPC have some problems with Hibernate. If you return PersistentSet when RPC expects Set, the RPC mechanism throw error. Also there are obvious problems with Hibernate proxies, java.sql.Timestamp. There is a library called hibernate4gwt which aims to alleviate these problems.

Alternatives : If you like the approach of building your AJAX apps in Java and let the tool take care of converting it to Java Script and HTML, you may like to look at projects similar to GWT. They are

· Echo 2– Similar to GWT. The number of widgets available is more when compared to GWT. Check the demo in their site.

· WebCream– Converts Swing applications to AJAX applications. They claim, if your Swing applications do not use many custom components, they can convert it into AJAX application without any changes.

· J2S– JavaScript equivalent of SWT. They are trying to build Eclipse RCP to web.

GWT is a good way of building AJAX applications for Java developers. It is not complete framework, keep T(tool) in GWT in mind. It provides you bricks. You need to build your wire frames and house, sometimes third party libraries may help you. Nevertheless, I feel it is far better way than building your UI using Java Script(Java Script really scares me). If GWT team comes up with more rich UI components and a framework on top of them(Imagine something like JFace ported to GWT), GWT is the way to go. It is over a year since GWT is around. With Google behind we may safely expect more good things happen for GWT.


1. GWT– Official home for GWT.

2. GWT Incubator – Ideas and Widgets that may go to GWT library.

3. MyGWT – Widget library. The best I have found and they borrow some of the concepts from JFace for viewers. The default look itself is great.

4.– Tracks news on GWT and very informative. You can also find about various libraries here.

5. Roberts Hanson’s blog – Blog from the author of the book, ‘GWT in Action’. He is creator of gwt-wl(widget library) and gwt-sl(server library, which provides controllers for integrating with Spring and other server side utilities).

6. Gwanted – Helps you to use GWT in any web page, Error management etc

7. hibernate4gwt – Helps you to solve problems with GWT-RPC and Hibernate.

8. gwt-ext library – The creator of the library is Sanjiv Jivan. He ported Java Script EXT library to GWT.

9. gwt-tk library– Provides widgets like drop down panels, glass panels, various types of dialogs.

10. GWM library– GWT windows manager provides window effects for GWT applications.

11.Other– GWT related projects from Google code.

12.rocket-gwt– Widget library.

17 thoughts on “GWT is cool, but not complete

  1. Nice Article.. Thorough…Though More issues around GWT could have been added..may be consider writing another part explaining other issues with GWT

  2. For UI widgets, some google code projects provide very cool widgets :
    MyGWT, gwt-Rocket,…
    You can search on google code and I am sure that you can find what you need in the projects list.

    About Server communication, I agree with you for SOAP. It is a major leak of GWT.
    But I disagree about the use of GWT-RPC and the compatibility with JDK 1.4.
    As I experienced with EJB3 and JSP/JSF, in presentation layer using simple specific objects that don’t map to domain objects is the best way to avoid problems concerning dependencies, architecture pitfalls, security leaks and performance. I think it is the same with GWT.
    In addition, if GWT was JDK1.5 compatible, how to manage annotations of Domain objects in the presentation layer, and primarilly about lazy loading?

  3. Thanks for reminding me about gwt-rocket. I forget to add the link.

    ‘in presentation layer using simple specific objects that don’t map to domain objects is the best way to avoid problems concerning dependencies, architecture pitfalls, security leaks and performance.’

    I am not sure about this. Can you explain it?

    My idea is not to avoid different transfer and domain objects. So that you don’t have to do conversions like they way we used to do in Struts.

    ‘if GWT was JDK1.5 compatible, how to manage annotations of Domain objects in the presentation layer, and primarilly about lazy loading?’

    I want the Java 5 compatibility for the same reason as above.
    I am not sure if features like lazy loading and annotations needed, I don’t know how they are going to be stored.
    When I say Java 5 compatible, I was talking about specific features like typed collections.(In the same way as GWT is compatible with Java 1.4.As you know you wont get all the features of Java like dynamic proxies etc).

  4. The proper way to view GWT is not as a widget library, but as an optimizing compiler. For GWT, performance is primary because user experience is primary. There will be more slick components built over time, but first, they want to get performance right: startup time, network roundtrips, memory usage, and code size benchmarks are unmatched in GWT. And GWT’s compiler deals with very obscure non-linear performance issues in browser implementations that most Javascript and Java frameworks don’t even bother with. (e.g. Safari’s issue with large JS arrays, IE’s issue with garbage collection triggers) Build a good foundation, and you can build better slick whizz-bang widgets on top.

    Think I’m joking? Compare Dojo’s Mail Demo ( to GWT (, look at code size and startup time, or # of HTTP requests. Likewise, ExtJs is a kick ass widget library, but it’s positively huge which means any non-trivial app will require lots of work to cap its size. Echo2 makes an enormous number of http requests and loads up tons of code. I’m not sure I’d want to use it as the base of a long running AJAX app like Gmail.

    So yes, I agree, GWT’s widgets are not slick and pretty to look at, and they need some work. But GWT’s foundation is better than all other toolkits I’ve surveyed. With GWT1.5’s trunk, my 15,000 line, numerically and graphically intensive app had its performance boosted by 100% just by recompiling, and that’s ontop of the 25% boost I got from GWT1.3->GWT1.4.

  5. Pingback: GWT Site » Blog Archive » Weekly GWT Links for 12/9

  6. Pingback: roScripts - Webmaster resources and websites

  7. The widget problem is solved. Just use – and with’s existence (and, might I add, very productive maintainer), it’s not a problem GWT should be solving anytime soon, either. GWT is the platform. Something like is a widget library built on top of it. This makes GWT a misnomer (Google Widget Toolkit – it should have been Google Javascript Toolkit or something), but if you look beyond that, a pretty sweet deal. Possibly GWT should endorse as an official widget extension pack of some sort.

  8. Pingback: WOW Technology Minute » Blog Archive » Google Web Tool Kit (GWT) Conference-Wrap up with a list of GWT Books and Links to Additional Content

  9. “As I experienced with EJB3 and JSP/JSF, in presentation layer using simple specific objects that don’t map to domain objects is the best way to avoid problems concerning dependencies, architecture pitfalls, security leaks and performance. I think it is the same with GWT.”

    I have been using GWT for two small projects and I totally agree with that comment. If what you want to show is a single object with few dependencies, maybe sending the object to the client side is okay. However, if you want to show a list of objects, then it is better to summarize them into a simple model object (e.g. a table of String, instead of a list of objects) on the server side. It not only reduces traffic but also reduces the code complexity.

  10. Nice review, but I have to say I don’t entierly agree 🙂

    Widgets: I actually like that they are basic and unencumbered by a bunch of “support” infrastructure. Fromt eh basics you can do pretty much whatever you like including build a more advanced UI library.

    On libraries like MyGWT and GETEXT: I’ve actually played around with those recently thinking they were the “move advanced UI library” i mentioned above, however it turns out that they are both not easy to use (poor design in some cases) and actually in the case of gwtext are interfaces to native javascript… which is actually a negative in the realm of GWT because the GWT compiler can’t optimize the javascript (optimization can make a huge difference in a large app).

    I have not yet explored the internals of MyGWT but I do know I wasn’t impresed with how you use the API.

    I expect in a year or two we’ll have some very good extension UI libraries available, but until then I’d recommend that you stay away from libraries like gwtext (despite it’s very high cool factor) unless your doing something simple and are prepared to deal with the weird (yes i use hat word) interface that is the legacy of the native javascript code.

    I have to agree with your comments on domain objects not translating well… but when you think about it, its not surprising. There have been inroads from ORM frameworks like Hibernate thoguh, and as time goes bey, better patterns will develop (maybe we’l develop them).

  11. Also would like to know more on implementing multiple modules in GWT with multiple entry points. Finding hard time to work with a single module

  12. Pingback: Reply to Comparing Java Web Frameworks « henk53

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s