An Ajax Duo

It's all about Ajax books this month, with reports on Foundations of Ajax and Ajax in Action.


May 25, 2006
URL:http://www.drdobbs.com/architecture-and-design/an-ajax-duo/188500283

Joey is Technical Community Development Coordinator for Tucows. He can be contacted at [email protected].


The simplest way to comparatively summarize Ryan Asleson and Nathaniel Schutta's Foundations of Ajax and David Crane et al.'s Ajax in Action is to say that Asleson and Schutta focus on tools, while Crane focuses on technique. Much of Foundations of Ajax is devoted to documentation, validation, and debugging utilities for JavaScript, HTML, and XMLHttpRequest and Ajax frameworks, while Ajax in Action prefers to spend its pages covering Ajax's structural aspects, adding polish and example mini applications.

Foundations of Ajax

Ryan Asleson and Nathaniel T. Schutta

APress, 2005; 296 pp.; $39.99; ISBN 1590595823

Foundations of Ajax takes a more "nuts and bolts" approach, devoting whole chapters to the XMLHttpRequest object, processing the response from the server and the authors' Ajax framework, Taconite (taconite.sourceforge.net). One chapter focuses on building an Ajax coding toolbox, covering tools to document, validate, compress, and obfuscate JavaScript, and to validate HTML, while another covers building a testing toolbox, examining tools for debugging JavaScript, and tracing XMLHttpRequest communications with the server. One appendix covers writing JavaScript to overcome incompatibilities between browsers. Most notable is Chapter 6, which a much-needed chapter on test-first development and the little-documented practice of JavaScript unit testing with JSUnit.

AJAX in Action

David Crane, Eric Pascarello, and Darren James

Manning, 2005; 680 pp.; $44.95; ISBN 1932394613

Ajax in Action is the larger of the two books, with over twice the pages of Foundations of Ajax. It uses these extra pages to cover Ajax in a "programming in the large" approach, devoting whole chapters to Ajax as an implementation of the Model-View-Controller pattern, the server side, usability, security, and performance. There's some coverage of CSS and DOM, both of which are topics that many developers I know have left to web designers but are an important part of Ajax programming. The book also has what I consider to be one of the best appendices ever included in a programming book—"JavaScript for Object-Oriented Programmers." In a mere 30 pages, it introduces experienced programmers to JavaScript's OOP paradigms, focusing on areas where JavaScript differs from "typical" OOP languages, from prototypes to closures.

Providing example code for an Ajax book is a challenge, as it would have many components: HTML, JavaScript, and CSS on the client end and on the server end, code that can be implemented in any language. Foundations of Ajax tends to take a "micro" approach, with most of its examples being of Ajax elements for user interface and networking and showcasing only one full application in the chapter covering the Taconite framework. All the server code in Foundations of Ajax is implemented in Java. Ajax in Action takes a more macro approach, devoting a whole chapter to each example. The first two examples cover basic UI elements, but the remaining three are more like full applications: a web portal, live search using XSLT, and an RSS reader. With the exception of the RSS Reader, which demonstrates standalone Ajax coding, each example's server code is in a different language: VB.NET, C#, Java, and PHP.

I hope that both books' authors or publishers—or perhaps some industrious reader—posts server code for the example code in many languages. This would make the examples more useful and immediately usable by a larger audience.

If the question you have about Ajax is, "I'm on a deadline—what tools are available, and how can I use them now?" Foundations of Ajax is your book. While much of the book is likely to date quickly, it has a lot of information on JavaScript coding that you will find useful in the here and now. If your question is, "I'm planning to build an Ajax application—what issues should I consider?" then the breadth and depth of Ajax in Action makes it a more suitable book for your purposes.

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.