Pro Web 2.0 Application Development with GWT by Jeff Dwyer recently came out last week. The book focuses on using GWT to develop a real Web 2.0 application called ToCollege.net. Jeff was nice enough to answer some of my questions regarding his book and to share his thoughts on GWT in general.
CF: Tell us a little about yourself and what experience you have working with GWT?
Jeff Dwyer (JD): In 2006 I got the entrepreneurial urge and set out on my own building a Web 2.0 site with GWT (http://www.myhippocampus.com/site/screencasts.html). Of course I didn’t settle on GWT immediately. As we all know, there are an almost infinite number of ways to approach the problem of creating rich web apps. Luckily for me, I tried GWT 1.0.21 early in my testing and never had a reason to look back. Working in an unfunded start-up shines a powerful spotlight on the relationship between writing code and getting results. The only thing worse than struggling for hours to get your site to work in different browsers is not getting paid for those hours! Programming with GWT meant I didn’t need to get a master’s degree in browser compatibilities and that I could refactor my code quickly and easily as my ideas changed. I initially did some of the graphically intensive things in Flash, but I eventually moved to pure GWT and was very impressed by how it handled an extremely complex DOM.
CF: Can you tell us a little about your book and what it covers?
JD: I’ve really tried to write the book that I would’ve wanted to read when I started with GWT. For me, figuring out the GWT basics was simple and pretty intuitive, so this book doesn’t focus very much on the basic UI elements. The tricky bits for me were understanding how to make GWT fit nicely into its environment. Getting it integrated with Maven, Jetty, Spring Security, Hibernate, SiteMesh, best practices for RPC etc. While I was building my application, I sure would’ve loved to have the source code of a functioning application. With that in mind I’ve built a full-sized web site called ToCollege.net. This is a real site that focuses on helping students with their applications to college. It has a heavy focus on being Search Engine Optimization (SEO) friendly, which is no small feat. I think the solution proposed is a pretty good one and definitely one of the more important chapters in the book.
The book also spends a lot of time trying to come to grips with the best way to split up your application. If you want GWT widgets on different pages of your application, it’s not always obvious what to do. I think the framework I’ve used on ToCollege.net is a good general purpose solution for people who aren’t building a simple single page application. I’m using Spring MVC, but the pattern is absolutely applicable to your web framework of choice. Beyond that, I also include a pretty in depth look at security, including XSRF and XSS attacks. Oh and Google Gears and Google Maps integration. Yeah, so there’s a bit there.
CF: How does it differ from the other GWT books out there?
JD: Well, it does cover 1.5, so that’s a big difference. I suppose I should talk about that here. The code for the book was written running on the GWT 1.5 trunk. Of course, 1.5 is taking a little bit longer to get out the door than we’d thought, but the book itself is up to date to 1.5 Milestone 1, and the source code you get from svn is running off Milestone 2 and will continue to be updated as 1.5 makes it out the door. It covers a lot of the great new things in 1.5. I tell you, ImmutableResourceBundle and the StyleInjector are so cool it’s painful. You have to feel sorry for anyone doing CSS sprites without ImageBundles.
CF: What do you like/dislike most about GWT?
CF: Thanks for answering my questions. Is there anything else you’d like to add?
JD: Well, please get in touch if you have any questions. The discussion group is available at http://groups.google.com/group/tocollege-net. This is a real living project so it’s continually in development. Next up on the to-do list is converting to the very cool Spring Security 2.0 namespaces and an overhaul of the GWT forum system. Oh, and don’t forget to pick up a copy: Web 2.0 Application Development with GWT