I was recently re-reading Jesse James Garrett's article Ajax: A New Approach to Web Applications and it struck me that the article was very much an introductory text on building web applications which skirted a number of real world issues. The core idea behind the article is that using DHTML and server callbacks results in web sites that are more responsive [from the end user's perspective] than traditional web applications. This is very true.
However if you are building a large scale web application there is more to consider when using AJAX than how to create a function that hides the differences between the XMLHttpRequest object in IE and Firefox. Problems that have to be solved [or at the very least considered] include
- How to abstract away browser detection from each page in the application
- How to efficiently manage the number of connections to the server created by the client given the "chattiness" of AJAX applications compared to traditional web applications
- How to reduce the amount of time spent downloading large script files
- How to create permalinks to portions of the application
- How to preserve or at least simulate the behavior of the browser's 'Back' button
At MSN we've had to come up with solutions to a number of these problems while working on Start.com, MSN Spaces, the next version of Hotmail, and the next version of MyMSN. We have built our own AJAX framework and come up with a number of best practices for building large scale applications using AJAX.
Much to my surprise Scott Isaacs (one of the inventors of DHTML and now an architect at MSN) has started a series on the problems that face web sites that plan to utilize AJAX and how we solved them at MSN. The first two articles in the series are Why Ajax is so 1999? Part 1 and Why Ajax is so 1999? Part 2. Scott will also be giving a talk at the Microsoft Professional Developer's Conference (PDC) about Start.com and some of the cool AJAX stuff we've done.
I actually expected this would be the kind of information we'd keep close to our chest since they give us a competitive advantage so it is quite a welcome surprise to see us sharing knowledge with the Web developer community this way. I've already started nagging Scott to write a book about this stuff or at least update his Inside Dynamic HTML for the new millenium.