Feb 27 2008
AJAX is the sauce in the ASP.NET Meal
Tomato Sauce is horrible on its own. In fact, it’s that bad that people dare each other to drink glasses of Tomato Sauce after a big night out. Despite the repulsion one might have to an individual serve of Tomato Sauce, it is actually brilliant when added to a meal. It adds taste and flavour to all sorts of meals including meat, chips, hamburgers and hot dogs. However, Tomato Sauce needs to be kept in place. Too much of it, and suddenly the meal it’s being added to, doesn’t taste so great, in fact it’ll ruin most meals if not used in moderation.
When it comes to building web applications that utilise AJAX, I consider AJAX to be akin to Tomato Sauce and ASP.NET akin to a Meal in that I love AJAX when it’s used to compliment an application, but absolutely hate it went it is applied so thickly that it ruins the application.
AJAX has been around for a good while now and I would have thought that people would understand that AJAX should be considered a complimentary tool designed to help add those nice extra touches to your ASP.NET applications, not the cornerstone for all architectural and design decisions involved in your application. One recent discussion I had with a solutions architect resulted in the solutions architect telling me that they were going to build the entire application using AJAX.
I felt like saying “I’m sorry, but you’re actually going to build an application using nothing but Asynchronous JavaScript and XML calls? That is very impressive”
If you were invited over for dinner and the host said “I’m going to cook you roast lamb, but I know you love tomato sauce, so Instead of using lamb, I’m just going to make the whole roast out of tomato sauce” I’ve got no doubt you’d be finding yourself suddenly busy that evening.
In recent times I’ve seen and heard of applications that seem to have been completely consumed by AJAX to the point that they’re just a horrible unmaintainable mess of hacks and JavaScript and like someone pouring a litre of tomato sauce onto a steak, the application is horrible to consume. It becomes slow and unresponsive, despite the fact that this is what AJAX is supposed to address and maintenance becomes a nightmare.
Like sauce, AJAX lends itself to being used more in some applications than others. You’d have no problem applying sauce liberally over a plate of chips, but you might just want a dash of it with a steak. Similarly, AJAX lends itself nicely to applications like google calendars and google maps, but it doesn’t really work so well when it comes to complex workflow applications or a web site like SMH, so you need to consider how much AJAX to use when designing your application.
So much hype has been generated about AJAX in recent times that you could be forgiven for thinking that AJAX will actually build applications for you, but developers really need to start understanding that AJAX is designed to complement the tools you already have and is not meant to be consumed on it’s own.
