Tuesday 25 September 2007

AJAX – a big step in the right direction

Every time there’s a great leap forward in computing, you kind of think that you would have thought of that (given enough time, etc etc). For example, when we were all working on mainframes with terminals attached and those guys struggling away in garages built small personal computers for the first time – I remember thinking it was brilliant idea and I’m sure I would have come up with the idea.

Then we had a long period of swapping files between PCs using floppy disks, and sending diskettes through the post! That was the only way to share files. I can remember waiting for the Fed Ex man with his box of diskettes to arrive. The solution, of course, was the Internet. I’m sure I must have thought of that idea – didn’t you?

Then we get to the stage where we work on notebook computers, talking across the Internet, and the Web server sends us a page, we make one change or entry and we send the whole page back. Then the Web server sends us a new page – one that probably looks 90% like the last one we saw. Did I say 90%, it could even look 99% similar, but the whole page was sent over the Internet to my browser. It must be time I had another of those "brilliant" thoughts!


And that’s how we get to AJAX technology. AJAX is an acronym standing for Asynchronous Javascript And XML (eXtensible Mark-up Language), which was originally coined by Web design consultancy Adaptive Path (www.adaptivepath.com).

Rather than the user pressing a button or hitting the Enter key triggering an HTTP request on the Web server, which then actions that request (by grabbing some data or calculating interest, or whatever), and finally sending back a new page, AJAX speeds things up by actually sitting on the end user’s computer and doing a lot of the work there. An AJAX engine will control most of what the user sees in their browser and be responsible for sending data to and from the Web server. By using hidden frames (typically) communication can be asynchronous, but (again typically) the AJAX engine will be able to handle most requests – which means that pages aren’t sent to and from the Web server. This makes things much faster and reduces network traffic.

The other very interesting thing about AJAX is the fact it control what the user sees on screen. And the reason this is important is because it allows applications like word processing or spreadsheets to be run from a Web server. And the reason that is important is because the application is platform agnostic and it can be updated anytime. Let’s unpick that last sentence a little. Basically, it means that users can run the same application on a Mac, a PC, or Linux – so long as they are connected to the Internet. It means they use the same application no matter whose computer they are working on. So gone are the days of people familiar with using MacWrite having to use Word, or AmiPro (or whatever). Users can always load their favourite word processor etc. And the other big advantage is that upgrades to the application happen easily and automatically. I use Word 2000 on one laptop, but have 2002 on a slightly newer one. They are very similar, but not the same. This would never happen with AJAX. As the application was developed, users would always download the latest version.

AJAX can easily offer word processing etc because it allows drag-and-drop and those other facilities we’re all used to through using a GUI.

But is this all pie-in-the-sky or is anyone really doing this? The answer is a definite yes. Google was a very enthusiastic supporter, and Google Earth (earth.google.com) uses it (although I can’t get Version 4 to work – Version 3 was excellent). Flickr (www.flickr.com) the photo sharing site uses it. And there are lots of others – so many that there’s no point my listing them here.

IBM is a big AJAX supporter. Early this year IBM announced the AJAX Toolkit Framework (ATF) for building Integrated Development Environments (IDEs) for different AJAX run-time environments. IBM has said that it will give away its Eclipse-based code to Open AJAX – an organization supported by BEA, Borland, Eclipse, Google, Laszlo Systems, Mozilla, Novell, Openwave Systems, Oracle, Red Hat, and Yahoo.

AJAX applications turn out to be particularly good at tasks such as updating or deleting records, returning simple Web queries, or expanding Web forms. This is because those activities don’t require a new page to be loaded. They can run on any platform that supports a browser. The skills required to write AJAX are really extensions to JavaScript and DHTML – which means there are plenty of developers who could do it. The other big plus for AJAX is that IBM has put its full weight behind it, and Microsoft is also now an AJAX supporter (see their ATLAS announcements).

AJAX users may notice a big difference between AJAX doing the work and a refresh from the Web server. It’s important with AJAX development that users pressing the “back” button see what they expect, and that they see an icon indicating that the computer is doing something. It’s also necessary to use a browser that supports AJAX – some old ones don’t.

On the whole, AJAX seems to offer next generation working today. It’s one of those developments that you think is so obvious you should have thought of it yourself. If AJAX itself isn’t the complete answer then it’s certainly a giant step in the right direction.

No comments: