During the last year, I have been involved in several projects developed with the Google Web Toolkit (GWT). Now, we are going to start a new project, and it’s time to evaluate the advantages and disadvantages of using GWT. In my opinion, these are the most relevant GWT pros and cons:
The advantages of GWT include:
- Debugging any GWT application it is as easy as debugging any pure Java application. In my case, I have been using the IntelliJ debugging facilities to debug both the client-side and the server-side Java code.
- Developing GWT is quick thanks to error checking and syntax highlighting.
- Easy to manage client history that means that GWT provides back button support.
- You can use both JUnit and Mockito for unit testing. GWT makes very easy to apply TDD (Test-driven development) or BDD (Behavior-driven development) patterns.
- GWT provides cross-browser support that means that your application will work similarly on the most recent versions of IE, Firefox, Chrome and Safari. Although we have found many incompatibilities with IE older versions.
- The UI Binder framework is an excellent tool to build your apps as HTML pages with GWT widgets sprinkled throughout them.
- Exchange Java object over HTTP between your client and server, it is straightforward using the GWT RPC framework.
- There are some good books about GWT. I would strongly recommend GWT in Action; it is very well explained and to the point.
The disadvantages of GWT include:
- Main Google recent projects are not longer developed with GWT.
- Used to have a good community behind but it is decreasing quickly.
- There is too much boilerplate code. Creating a simple table in GWT could take you more than a hundred lines.
- GWT is only useful for Java developers, if you are coming from a different background I don’t think GWT will be helpful for you.
- UI tests are too slow. Although, if you apply correctly the Model-View-Presenter design pattern, you could minimize the use of GWTTestCase, and write fast JRE tests.
We have seen the strengths and weakness of GWT. In conclusion, GWT is a great a tool, especially, for people like me that came from a Java background. It is simple and easy to use thanks to error checking, UI Binder, and the possibility to debug very easily.