Dr. Dobb's Journal January 2003
As a programmer, I find googling through documentation easier than flipping pages. I also find that on-line documents are more likely to be in synch with the latest versions of the software they describe. As a result, the first thing I do when I get a new book these days is ask myself how much of its content is reference material that is available on the Web. The second question I ask is, "How fast will this material go stale?" If the answers are "most" and "quickly," I usually set the book aside.
To be worth printing in these wired times, a book must teach concepts rather than just APIs, since the latter are all too likely to have changed by the time the book reaches its readers. Books must also analyzeand critiquewhen, where, and why to use the things they describe.
By these measures, Brett McLaughlin's Java & XML Data Binding deserves a good grade, though not a stellar one. Data binding is the process of translating a nest of data structures into a persistent format and back again. McLaughlin shows readers how to do this when the data structures are in Java and the persistence format is XML.
After a lightweight introductory overview, the book devotes one chapter each to generating classes, marshaling, unmarshaling, and binding schemas using Sun's JAXB framework. McLaughlin admits that JAXB is immature, but the Sun brandname means it will probably win out over Zeus, Castor, and Quick, which are covered in the book's second half.
McLaughlin writes well, and is careful to describe what's going on under the hood in enough detail so that readers can debug. His examples are well chosen and well explained, and he is careful to point out features that are still evolving and likely to change. As a developer, I'm grateful for the warnings, but they are a signal that the technical details in the book are likely to go stale rather quickly. Java & XML Data Binding is a good introduction to how and why, but I would double-check the details it presents against online documentation before starting to write code.
Andrew Patzer's JSP Examples and Best Practices does not suffer from this "best-before" problem to the same extent. For one thing, JSP is a more mature technology (which in our industry means "it now contains legacy features"). For another, enough people have built enough big systems with JSP for architectural principles and design patterns to have crystallized.
Those principles and patterns are the real subject of this book. Patzer assumes that readers have some prior experience with JSP; his review of basics in Chapter 1 is only 25 pages long. From there, he moves on to separating data models from views and controllers using JavaBeans and custom tags, and then to patterns such as decorating filters, front controllers, and view helpers. Testing and deployment merit one chapter each; as someone who wrestles almost daily with integration issues, I found this material particularly useful. If I had written (or edited) the book, I would have tried to compress the source code of the examples somewhat, but this is a minor quibble with a fundamentally solid book.
And speaking of design patterns brings us to the last of this month's booksSteven Metsker's Design Patterns Java Workbook. I have been reading (and occasionally writing) about patterns for six years and thought I knew my way around it pretty well, but this book still made a lot of new connections for me. This is almost entirely due to Metsker's careful, step-by-step exposition. Every point is illustrated by a small code sample or by a challenge to readers. These challenges only require a few minutes each; by scattering them through the text as he does, Metsker creates an almost conversational dialog with you. The result isn't a quick read, but it is a very rewarding one.
DDJ