‘Ajax in Action’ Book
I’m pleased to announce that I’ve been hard at work on a book about Ajax, the technology previously known as ‘DHTML/Javascript Rich Clients’. I’ve been talking to Manning publications about this since November last year, and trying to articulate my ideas for some time before that as a series of articles. I’ve been playing and working with DHTML since the late 1990’s, and spent the last two years developing ‘Ajax-based’ applications for the banking industry as senior UI dev on a team of roughly ten. My partner in crime Eric Pascarello has been working in the trenches too, manning the HTML/Javascript bulletin boards at the java ranch.
Javascript and J2EE make an interesting fit, not so much in terms of the technology, but the cultures. I’ve had a background in both for some time, but let them run like separate threads without much overlap. In the last couple of years, though, I’ve done a lot of hard thinking about what is needed to bring javascript into the enterprise, and how to structure large javascript/DHTML codebases.
Happily, Jesse James Garrett of Adaptive Path has done us all a big favour by providing a dandy buzzword for these monstrously-long-named technologies, which has helped to reduce the number of words that I need to hold in my head at once, and to bring these things into the public arena. Sure, this has brought a sort of gold-rush fever with it (readers too young to remember the Gold Rush of the 1840’s may recall the dot com boom and bust of the last 5-6 years!). There’s a lot of noise going on in the Ajax space right now, but there’s still a lot of room to explore what can really be done with it. It could seriously changes the way we use the web browser. It can also seriously screw up usability by providing lots of weird eye-candy and dancing special effects, of course, and every gold rush has its share of hoo-hah.
I’m going to cover the usual suspects in my book - how to use CSS, javascript the DOM, XmlHttpRequest and its various friends and relations - but I want to get deeper than that too. There’s a world of difference between knocking up a quick proof of concept and crafting something that a user can use day in day out as their main work horse. I’ve learned this the hard way (and have the scars to prove it!). With the new book, I’m hoping to be able to pass on some of the nuggets of experience that I’ve won along the way.
I’ve blogged a couple of short excerpts from the book here too, just to give an idea of where I’m heading.
June 22nd, 2005 at 1:12 pm
Sounds interesting. Do you have any ideas on a release date? Also, what sort of approach will you take to cover the frameworks popping up all over the place to support ajax or integrating with ajax?
June 22nd, 2005 at 8:38 pm
Hi Rob,
There are quite a few frameworks popping up, aren’t there? We can’t hope to cover all of them, and more will inevitably appear between finalising the manuscript and the publication date. Looking at a lot of the frameworks from a design point of view, I see a lot of similarities in style, so there’s plenty to talk about without getting stuck on a particular implementation.
June 25th, 2005 at 6:21 pm
hi, Dave
It is great that some like you and Eric giving us guidelines of how to use AJAX right! I have got some requirements from our boss that he wants to to use web browser to replace one of our critical products that is written in SmallTalk (fat client). In order to maintain the usability, we decide to adopt AJAX…. However, we found out the unknown in AJAX that I hope guru like u or Eric can give a light.
(1) Request Ordering
AJAX sends request asynchronously back to server, but we cannot guarantee the order of the requests being process and/or the order of the response being send back. Let say I have a spreadsheet app, there are 3 cells A1, B1 and C1 and A1+B1=C1 (the formula is simplied to illustrate the point. In reality, it is complicated formula that needs to execute in the server side). When I change A1 then B1, there are 2 requests send back to the server for calculation. Ideally, the response of the last request will tell me the final result of C1. But if the response of first request comes after the 2nd. The change of B1 will be lost! How to guarantee that?
(2) Error Handling
If the request is lost somehow, will XMLHttpRequest timeout? Besides, if each request use a new XMLHttpRequest, are there any thread contention when the responses come back that may modify the same field… (again, it sounds like ordering or synchronous issues…)
thanks
ray
June 26th, 2005 at 10:13 pm
Hi Ray,
Thanks for the kind words, and good luck with your project - sounds like a familiar scenario to me :-)
To answer your specific points:
(1) you’d need to specify in the second request that it should cancel the first one, as both are targetting the same destination cell. Use cell id as a uid maybe? Command pattern has some useful features for cancelling and undoing user actions which you might like to investigate.
(2) Internet Explorer typically only allows two http connections at a time, IIRC - can be altered with a registry hack, I think.
June 27th, 2005 at 4:20 am
Thanks for the response!
Maybe I simplifed my case too much. Actually, I cannot ignore request completely. Let say there are 2 spreadsheet rows, each change in a row will trigger the changes of subtotal and grand total (yes, not just one destination). When user changes cells of rows, the grand total will be the problem if the response order is not guaranteed. I am thinking to implement an event queue in javascript but I am not sure whether it is the only way to go…
For the IE 6 only supports 2 connections at a time, is that means the request will be queued til the connections are free? If so, the asynchronous behavior of AJAX is limited and the responsiveness of the UI will be hurted.. am i right?
thanks
ray
September 12th, 2006 at 8:40 am
Chapter 9- Creating a double combo linked list with AJAX.
Dear Dave and Co,
I love love love Chapter 9. This is perfect for my website. The only problem is Listing 4:DoubleComboXML.aspx.vb is outside my realm of understanding. I am writing in PHP and AJAX is new to me so bringing it all together with that .vb program is messing with my total coherance. Is there any way you could clear this up for me?
If not, I will just suffer and leave my page submiting the traditional way.
Thanks,
Colleen