Book Review: Google Web Toolkit Applications

January 2nd, 2008 - Written by in Reviews

google web toolkit applications book is the latest book in the GWT library. When I first heard about the book, I knew I needed to buy it. The author, Ryan Dewsbury is well known in the GWT community as the creator of GPokr and KDice, the most popular GWT applications up and running today. I was very interested in learning what Ryan had to say about building practical GWT Applications.

The book is clearly aimed towards beginning and intermediate GWT developers, but I’m sure expert users will be able to learn some new tricks as well. The book is divided into two sections. The first five chapters provide an overview of GWT concepts and features. The last five chapters step through the process of building five different GWT applications: a Google Desktop clone, a Multi-View search application, a Blog Editor, an Instant message client/server and a Database Editor. All of the applications are designed using a model-view-controller architecture and useful patterns are highlighted. Ryan then walks through the construction of each application, illustrating relevant parts with code and diagrams. Except for some of the latter parts of the book, I like the fact that most of the code snippets are concise and easy to understand. The applications can be seen in action on Ryan’s website at http://www.gwtapps.com.

Chapter Highlights

Chapter 1 gives a brief overview of Ajax, current web technologies and where GWT fits in. There’s also a quick tutorial on building a GWT Hangman game, and the chapter ends with an overview of the various GWT packages.

Chapter 2 highlights the GWT user interface package. Each of the various GWT widgets and panels are explained in some detail. The rest of the chapter goes over the GWT Event interfaces and how to bind the widgets together.

Chapter 3 discusses how to use GWT to interact with a server. First, we learn how to use GWT’s RequestBuilder to make asynchronous calls. Then, the chapter describes how XML and JSON are used as a mechanism for passing data to and from the server. We also get our first exposure to the Same Origin Policy and learn a few techniques which enable us to integrate third party services into our GWT apps. The chapter concludes by describing the GWT-RPC mechanism.

Chapter 4 describes the process of first installing GWT and then setting up and working with the Eclipse environment to start writing GWT applications. There is a walkthrough of using the Unit Test framework to test the Multi-Search application (described in Chapter 7). There’s also a brief discussion on benchmarking and working with GWT modules. Finally the chapter ends by discussing how to deploy applications in various environments.

Chapter 5 talks about a variety of miscellaneous topics. These include:
- Back button support
- Using CSS
- Building custom widgets
- Using JSNI
- Providing Cross-Browser support
- Integrating with other Javascript libraries
- Internationalization
- Code Generation
- Improving Performance

Chapter 6 shows the first application, a Google Desktop clone. The chapter starts off with the design of the Gadget model and the Desktop views. Next, drag and drop is demonstrated to create draggable and dockable gadgets and the app’s look is improved using CSS. We see how to save user preferences using cookies and then using Google Gears. Finally the chapter describes how to integrate with other third party Javascript libraries like Google Maps and the Google Ajax API to create new and more interesting gadgets.

Chapter 7 features a Multi-Search application that aggregates the results from various search engines. The chapter gives us a more in depth discussion of using JSON as a data format and the Same Origin policy. Then the chapter concludes by showing how to integrate with various search APIs like Yahoo! search, Google Base, Flickr and Amazon Search using these techniques.

Chapter 8 shows how to build a Blog Editor application that can integrate with an existing Blogger account. The chapter describes how to interact with more complex webservices by creating a HTTP Proxy Servlet, which is another method for bypassing the Same Origin Policy. With that in place, the rest of the chapter talks about how to integrate with the Blogger API using the GData protocol.

Chapter 9 goes through the design and implementation of a simple Instant Messenger application. After an explanation of the client portion of the app, we next get a look at the various techniques for creating event based protocols over HTTP. There’s a discussion of the hanging RPC call method, but we also learn about more scalable techniques using technologies like Comet (with Tomcat) and Continuations (with Jetty).

Chapter 10 shows how to create an Ajax style Database Editor. The first part of the chapter gives a detailed look at implementing the Database Editor views. Next we see how to integrate with a backend database using three different server integration methods. The first is with a PHP server using an Action based API. The second approach uses REST to talk to a Rails based app and the third method utilizes the GWT-RPC mechanism. There is also an extensive section on writing a GWT code generator to serialize/deserialize JSON and XML.

Conclusion

Overall, I think Google Web Toolkit Applications is an excellent book. It is easy to read and does a really good job covering all the major GWT topics and more. The applications demonstrate software development best practices and cover a variety of interesting techniques. The only negative about this book is that at the time of this review, not all of the source code for the applications is available, although it looks like Ryan will have them all up soon. The book has its own and Ryan is active in answering questions. If you are really serious about doing GWT development, then you’ll definitely need to add Google Web Toolkit Applications to your reading list.

9 Comments Stumble it!

Weekly GWT Links for 12/23

December 23rd, 2007 - Written by in News, Using GWT

Here are some of the more interesting links from the past week.

  • Interview with Dion Almaer – Didier Girard of onGWT.com has posted a really interesting interview he did with Dion Almaer at this years Javapolis. Dion works at Google on the Google Gears project and is also the founder of Ajaxian.
  • – A Facebook application written in GWT. Numbrosia is a number/slider puzzle game.
  • – The Rocket GWT framework is “a collection of widgets, and other useful abstractions for authoring GWT applications.” This latest release contains some GWT serialization improvements.
  • GWT RPC Presentation – Links to the slides and notes of Rob Jellinghaus’ presentation on GWT RPC at this years GWT conference.
  • GWT Testing with Groovy – Tutorial on using the Groovy programming language to do GWT unit testing.
  • GWT Vector Graphics Library – Interesting looking demo. Unfortunately, the library itself doesn’t seem to be publicly available at the moment.
  • Gwittir for GWT – Gwittir is a project whose goal is “to provide a set of code generators, scaffolding, utilities, and a basic MVC framework for use with Google Web Toolkit based applications.” This article shows how to use its Bean binding and Animation mechanisms.

Have a Merry Christmas everyone!

No Comments Stumble it!

GWT Serialization Tutorial

December 20th, 2007 - Written by in Using GWT

The guys over at developerlife have been putting up new GWT tutorials at a prolific pace. Their newest tutorial demonstrates how to use the GWT Serialization mechanism in a Contact List application.

Check out some of their previous tutorials as well:

For a list of other good GWT tutorials, you can also check out the Resources page on this site. Feel free to leave a comment and suggest your favorites.

1 Comment Stumble it!

« Previous Entries Next Entries »