Saturday, January 9, 2010

"GWT In Practice" Report Card


Student Name:GWT In Practice
School:Manning
School Year:2008
Teacher:Hamlet D'Arcy
Overall Grade:B (solid effort; time well spent; not enough on client side)

Grading Scale: A=Outstanding, B=Good, C=Average, D=Poor, F=Fail











Server Side ProgrammingA
Knowledge of GWT RPC (Remote Procedure Calls)A+
How Ajax calls are made from the client to the server using GWT RPC is clearly explained in a variety of use cases (almost too many!). The difficult to understand relationship between service interfaces, server/servlet implementations, and the client asynchronous interface is explained in words, with diagrams, and within the IDE. Explaining GWT RPC is where GWT in Practice really shines... and this topic is still relevant today in GWT 2.0.
Knowledge of Alternative Server StacksA
GWT in Practice demonstrates how to consume REST and POX services with GWT, how to integrate Flash for SOAP services (not a good idea IMO), how to use Java Applets(!) for a SOAP client, and how to use Comet for streaming data to clients. The book focuses so much on server side technologies that perhaps it should have been called "GWT Server Stack Recipes".
Knowledge of Security ConcernsA
The Manning "In Practice" imprint means the author is targeting real world developer concerns rather than giving a generic overview, and security is one of these real world concerns. GWT in Practice does a great job explaining all the cross site scripting concerns (and how to work around them), security certificate issues (and how to work with them), and how to configure Tomcat security (which isn't even unique to GWT). It's clear the authors have real experience with securing a GWT app in a variety of contexts.
Knowledge of GWT TestingB
GWT ships with both GWTTestCase (for easing the testing of asynchronous and multithreaded components) and a performance benchmarking tool. The tools are straightforward and covered in every other GWT text as well. While a testing section is essential to any GWT book, this one didn't stand out against the other material. I'd have liked to see more testing best practices. Plus, GWT ships with a new performance testing tool, so this section is starting to age.
Creative Code SamplesB
The book deomonstrates how to turn on history to support the browser back button and how to record and playback certain Comet messages. The former is useful (and part of the GWT project) while the latter seems unlikely to be needed by almost any other GWT developer (and is custom implemented for the book).










Client Side ProgrammingC+
Knowledge of Standard GWT Widget SetC
Granted, the "in Practice" title is not meant to be a basic introduction, but there is almost no material on the standard GWT widget set. If you want to know all the user interface widgets supported by GWT then look elsewhere. However, some widget layout and CompositeWidget material was covered, the GWT in Practice salvages a C grade.
Knowledge of JSNI (JavaScript Native Interface)B
Surely the most controversial part of GWT is the ability to embed JavaScript within multiline comments of Java files. Sounds nasty even if IDEA does support refactoring and highlighting, right? (And as of 2.0, Eclipse does as well). This books contains a ton of JSNI. Pages of it, actually; which isn't always a good thing for the book or for GWT. GWT in Practice will definitely show you how to wrap JavaScript libraries, even if it makes for poor reading. The best part of the JSNI examples was the recipe for adding drag and drop, which appeared twice in the book for some reason. If you need drag and drop or to wrap a JavaScript library then this is the book for you!
Knowledge of CSS StylingB
CSS styling gets a whole 2 pages. Which means there isn't much to say beyond what the browser offers already.
General Client ConcernsC
There simply wasn't enough information about client side programming in GWT in Practice. The example that were shown left me wondering, "Is that something I'll really need to do?"








GWT Best PracticesB+
How to Design GWT ServicesA
This is the only book I found that included best practices about how to design services, which the author recommended using DTOs and keeping interfaces seperate from implementations to decouple physical services. However, some of the diagrams seemed forced and pointless (and they were, did you know Manning requires a visual aid on every spread?)
How to Design GWT ClientsF
What should client side design be in an Ajax application that consists of pretty much just one web page? This wasn't covered at all. Note to authors: please include this in your GWT 2.0 update! Also, there was no coverage of how to deal with degenerate browsers like IE6. This is the bane of my current project and any hints would be appreciated.
Knowledge of the Best Tools for the JobB+
GWT in Practice shows NetBeans, Eclipse, and IDEA in action. The most helpful diagram of how a GWT project is structured was actually an IDE screenshot. For builds, the Maven plugin is covered ad naseum, which is understandable considering the authors wrote it. But still, Maven is dead to me so it was time wasted (now where is that Gradle GWT plugin)?



Teacher Comments
Even in light of the GWT 2.0 release, GWT in Practice holds up as a solid GWT book for newcomers. It definitely favors the server side and gives the client side short shrift. My biggest complaint was that it seemed to be a lot of recipes bundled into an "in Practice" format, and many of the recipes I didn't need (Flex? Applets?). Given the book is from 2008 when GWT had just been released, I wanted to dislike it. But it's held up quite well. It should not be the only GWT book you read, but probably it should be one of them.

2 comments:

Robert "kebernet" Cooper said...

Thanks for the review.

I think a lot of your criticisms are certainly fair. I think a large part of it goes to our goals in writing the book.

Manning of, course, had two books in simultaneous development: ours and Handson/Tacey "GWT in Action." There was a clear mandate on our book that we not step on their toes too much, so while we still spend a couple chapters bootstrapping the reader, extensive coverage of the client libraries does get overlooked. Mostly because we were trying to leave that to our sister publication.

The tooling coverage specifically (and yes, Maven heavy since that was what Charlie and I were using at the time). But, more to the larger point about the extensive coverage of JSNI, various coms, and other non-GWT stuff: We were trying above all to provide a book about how to work with GWT in the "enterprise" environment people already had established.

We spent, some say, too much time talking about MVC and 3-tier patterns, rather than the client libraries themselves. Mostly we saw this as trying to bring a generation of people who have cut their teeth working with action-based web frameworks (Struts/Rails/ASP) back around to what original 3-tier development looked like.

Speaking to the short coverage of CSS: I guess specifically, I am not sure that GWT changes the dynamic of CSS much. Of course, this opinion is right out the window with 2.0 and the new compiled stylesheet system (which I love). Again this goes to what we saw as our target market: developers who have been doing "web" for a while and are coming to GWT.

And yes, I wish I could show you the number of editor notes we got telling us to add more pictures and less code. That was certainly not my personal inclination writing it.

Hamlet D'Arcy said...

Thanks for the comment. If you had included everything for everyone then you'd get criticized for having a 1000 page book! I hope people focus on the comment "solid effort; time well spent". This was a good book.