May 03 2006Comments
Pragmatic Ajax, by Justin Gehtland, Ben Galbraith, and Dion Almaer
Reviewer's Disclosure: I (Stu) own a company with Justin, and am very good friends with Ben and Dion.
Quick Summary:Strong introduction to Ajax; excellent comparisons building simple Ajax functionality with a variety of the best client and server side tools.
I would divide Pragmatic Ajax into five parts:
- Introduction and Background (Chapters 1-4)
- The Client Side (Chapters 5-7, with a few asides)
- Intermediate Concepts (Chapters 8-10)
- The Server Side (Chapters 11-15)
- The Future (Chapter 16)
The introduction and background chapters are strong. This material is similar to material in every other Ajax books, with a couple of distinguishing features. Chapter Two builds a Google-Maps-like application. While I don't think most developers will use Ajax to build mapping applications, this is just cool. The other, more important feature is the choice of a very simple example: the Zip code lookup. Chapter 3 introduces a form that automatically populates a city and state as the user enters a Zip code. I like this example (and use it myself when training) because the basic code is incredibly simple. As a reader you can focus on the Ajaxy parts, without getting bogged down in the complexity of the sample itself. Rather than introduce a ton of new examples as the book goes on, the authors re-implement this example about a dozen times throughout the book, comparing and contrasting wire formats, client libraries, and server libraries.
The intermediate chapters answer the question "I can build a basic Ajax application, what happens now?" Chapter 8 introduces a variety of tools for debugging Ajax applications inside various browsers, including logging, DOM inspection, and step debugging. Everyone should learn these debugging tools--I am constantly surprised to discover developers troubleshooting their Ajax apps with nothing more than their browser and intuition. Chapter 8 also sneaks in yet another cool Ajax framework, MochiKit. Chapter 9 shows how to make your Ajax application "degradable," i.e. functional in non-Ajax browsers. Chapter 10 introduces JSON and JSON-RPC as an alternative to XML.
The server-side chapters compare and contrast different server-side choices for Ajax: PHP (Sajax and XOAD), ASP.NET (Atlas and Ajax.NET), Java (with DWR), and Rails. The authors made three smart choices that make these survey chapters work better than similar chapters in other books:
- These are the right four choices to cover
- All the examples are the same Zip code lookup, so you can focus on the language and tool differences
- You don't have to wade through pages of setup instructions unrelated to Ajax
The futures chapter covers several emerging technologies and standards that haven't hit their stride yet, e.g. E4X, Canvas, and SVG. At least one of these technologies will be very important in the next generation of Ajax apps, but I am not sure which. :-)