I saw this on Mary Jo Foley’s blog today: ASP.Net AJAX has been released. This is the add-on to ASP.Net 2.0 which was formerly known as “Atlas”. It’s a combination of .Net code (on the server) and Javascript code (on the client) that allows you to set things up in your .Net code, and not have to write a line of Javascript. It may have some add-ons for the Visual Studio designer as well, but I’m not sure. I haven’t looked at it.
Background
AJAX has had a long history, 10 years in fact. It’s my understanding that it all started with IE4 in 1997. It introduced a Javascript method called XMLHttpRequest(). This is what made AJAX possible. One of the earliest AJAX applications, before Google Maps, was a web add-on for Microsoft Exchange Server, called Outlook Web Access, or OWA. It reproduced the look and feel of Microsoft Outlook (pretty much) in a web browser.
Whenever a traditional web application needs to update a page, it does what is called a “round trip” to the server. The entire page is sent to the server, and then a whole new page is sent back. You will often see the whole page refresh in the web browser screen. This typically happens when you click on a link or a button in the browser window. This is not a very efficient use of network bandwidth, particularly if the change is small. Depending on the speed of the network and the server the browser is communicating with, this process can also be slow. It’s reminiscent of the way old mainframe terminals used to work, except that they were completely text-based.
AJAX is a method by which a client web page can make an asynchronous request to a server, and receive a response back, without having to use the “round trip” method. This is done using Javascript on the browser. The Javascript code takes the response and uses it to update just the part of the web page that needs to be refreshed.
It’s a hack. Some might even call it a kludge. For those not familiar with this term, I believe it goes back a long ways. A “kludge” is when you use something in a way that is contrary to its design or intended purpose, but works anyway. The XMLHttpRequest() call enabled AJAX, but the Javascript language and the browser were not adapted to this new way of doing things. Instead the Javascript call was added, some code was added to the browser to make the call work, but nothing more was added to the browser that would’ve made AJAX make more sense.
I’ve seen some descriptions of how AJAX typically works, and it’s loopy. Anyone who believes in software engineering as a discipline recoils in horror at it (okay, I exaggerate a little). It’s very messy. Making AJAX cross-platform is even more of a challenge, because not all Javascript calls work on all browsers. This is the reason that ASP.Net AJAX and other such frameworks are nice, because you can work with a more familiar language, like C# or VB.Net, work with a nicely constructed framework, set things up the way you want them on the server end, and the framework takes care of sending the right Javascript to the browser at the right time to get the job done so you don’t have to worry about it. You can get the benefits without having to “get your hands dirty”.
Where things stand now
Right now AJAX and Flash (and technologies that work with it) are the future of web development. WPF from Microsoft was released earlier, but in the eyes of one expert who has done application development for many years it’s not ready for prime time yet. I went to a presentation on WPF last night by Rocky Lhotka, and the sense I got of it is it’s nice for creating web-like applications that have a multimedia focus, but it’s not ready for anything serious in the realm of business applications yet. It would be alright to use for simple applications that need only simple form input. Anything more sophisticated than that, and you’re looking at a headache. The way WPF works is not that much different than the way a web browser works at this point. I’d put it at the level of IE 1.0 or 2.0. It allows some logic to be used on the client side, but it doesn’t allow the flexibility of Javascript in a browser. Rocky said it might be another 2-4 years before WPF is up to the level of Windows Forms. He predicted that it’s the future of rich client development, but it’s not that great to work with yet.