Relevance Review #5: Ajax in Action

Ajax in Action, by Dave Crane and Eric Pascarello.

Quick Summary: This is an excellent book.

I liked almost everything about this book. Some specifics:

  1. The authors have deep and wide experience designing and building Ajax applications, and this experience goes way back before the term "Ajax" was coined. The authors have been there, and are sharing hard-earned lessons.
  2. This is a book about ideas, not just a technical manual. The ideas start immediately in chapter 1, where the authors introduce their "defining principles" of Ajax. Chapters 4 and 5 are also "idea" chapters. Chapter 4 re-evaluates how MVC can/should work in an Ajax world. Chapter 5 discusses different data-exchange patterns that are possible with Ajax. Understanding these patterns is critical to designing an Ajax app, and they are poorly understood. In my travels I have found that most people are (unknowingly) using what the authors call "content-centric interactions". Usually they are surprised to find out that other patterns even exist!
  3. The case studies are detailed, and pull in a variety of useful concepts that are not specifically Ajax. Along the way you'll learn design patterns (3.2), refactoring (throughout!), reflection (4.5), and profiling (8.2). Some readers will find this information to be old hat, but with the popularity of Ajax I suspect many readers will be seeing these concepts for the first time.
  4. The ideas are nicely interwoven with technical detail. For example, Chapter 7 (Security) deals in specific technical details, e.g. the Mozilla PrivilegeManager, various workarounds for the "server of origin" policy, man-in-the-middle attacks, and public key crypto. But these details do not stand in isolation. Instead, they build up to a neat discussion of why coarse-grained APIs are easier to secure (7.4).
  5. As the authors state in 1.2.4, "[Ajax] is real coding and requires discipline." If you are writing Ajax you need take JavaScript seriously as a language, and know the tools you have available. The two appendices to the book provide exactly the information you need to get started.

The only negative I would point out is actually more of a call to action. Most developers should use an Ajax framework or library, and all developers should write tests. Unfortunately, there is not much book coverage (here or anywhere else) on either of these topics. Of course, the problem here is picking which specific things to cover: There are dozens of frameworks that you might cover, and several of them embed their own testing framework. I hope (and expect) that 2006 will see a new crop of books that target individual frameworks.

Conclusion:Ajax in Action will age well, and still be valuable when the next generation of Ajax books comes along. Read it, and keep it on the active shelf.