Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Design

An Ajax Duo


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.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.