CHANNELS
 
 
 
 
 
 
 
 
ON THE WEB
 
 
 
 
PRINT EDITION
 
 
 
 
BZ MEDIA
 
 
 
 
ADVERTISER LINKS
 
 
 
 
 
LOADING...
LOADING...
 
 
AS OF 8/21/2008 7:49PM EST
AJAX Is No Panacea
By Allen Holub

March 1, 2006 —  Every so often the industry is overcome with a collective madness so pervasive that the sane among us are forced to check ourselves into the asylum. The current embodiment of this principle is AJAX, a technology that all of us will be using sooner rather than later, but a flawed technology nonetheless. AJAX solves a problem that Java solved six years ago, but the Java solution was firmly rejected by the industry. I’m speaking of applets. The fact that an applet-based solution to the rich Web client problem wasn’t viable is fully Sun’s fault, but nonetheless, AJAX is really a triumph of politics over thinking.

Since its adoption is inevitable, I’ll be looking at various AJAX tools and initiatives on and off for the next few months, but first I want to whine.

The first thing to bear in mind is that AJAX equals JavaScript. An AJAX toolkit is nothing but a massive JavaScript implementation of features that should have been built into the browser. AJAX carries with it all of the massive headaches associated with any language that actively promotes bad program structure. The toolkits are huge blobs of unmaintainable gobbledygook that only the author can understand.

In theory we can just use the toolkit without worrying about the implementation. In practice, the inherent bugginess of all JavaScript programs (and lack of documentation for most of them) forces us to deal with the code. Some of the toolkits are so delicate that you will be loathe to touch them. Moreover, vast amounts of this complexity are centered on just getting the toolkit to work across browsers—a problem that Java solves elegantly.

Perhaps the various AJAX initiatives like the recently announced Open AJAX will eventually create something useful—essentially burying JavaScript inside a widget library—but for now the learning curve is steep indeed. Frankly, the real solution is to just fix the @#@&*%! browsers. Build in a real language that’s implemented the same way in every browser, which has a well-thought-out interface toolkit as part of the language. I’m not sitting on the edge of my seat waiting for that to happen, so AJAX is what’s left.

But wait a minute! We already have a good cross-platform thin-client toolkit: Java! The technology that could have saved the day—Java applets—has fallen off the face of the Earth. Sun abandoned a visionary approach to Java long ago in favor of being led around by the nose by the large corporate clients. Consequently, resources that could have been put into realizing Java’s promise of rich-client applications delivered over the Web have been redirected into useless junk like EJB (another good example of the myopic madness I discussed earlier).

There are other issues, too, that create problems with Java. But they could be overcome.

For example, the JRE is way too big for a casual browser to want to download. There’s no reason why a lean and mean JVM, akin to the J2ME JVM, wouldn’t solve this problem, but Sun seems unwilling to move in that direction. The succubus of compile-once/run-everywhere is too seductive, even though J2ME is proof that rigid adherence to this principle is nonsensical.

Note, by the way, that some of the objections that people had to applets are still not solved by AJAX. For example, an AJAX toolkit is a massive thing—easily as large as the .class files that you have to download in an applet-based page (but at least the runtime is already in the browser). Neither Java nor AJAX solves this problem. Similarly, because of the cross-browser behavior issues, you’ll still have to test on every browser, as you had to do with the original AWT applets. No AJAX toolkit—particularly the open-source projects like dojo—will solve every client-side behavior problem. For one thing, you’ll have to augment the toolkit with JavaScript of your own, which will have to be tested in every browser on every platform.

So AJAX is with us whether we like it or not. It doesn’t do anything new, but it’s a juggernaut. Fortunately, there are a few good AJAX toolkits that will help here and there—I’ll talk about a couple of them in my next column—but AJAX is not the panacea that the hype would lead us to believe.

Allen Holub is an architect, consultant and instructor in C/C++, Java and OO Design. Reach him at www.holub.com.
 


 
 
 
 
 
 
 
 
 
 
SUBSCRIBE TODAY!
 E-Newsletters:
  News on Mon/Thurs.
  Test & QA Report
  EclipseSource
 
 
JOB BOARD
 
PDF & PRINT EDITION
* Requires Resource Account!  LOGIN or SIGN UP

Download Current Issue!
ISSUE 8/15/2008 PDF

Need Back Issues?
DOWNLOAD HERE

Receive The Print Edition?
SUBSCRIBE HERE
 
REGISTER
 
GET NOTIFIED!
About all of the latest Resources
 
 
SD TIMES 100
It's time once again to
recognize the organizations
or individuals that have
demonstrated leadership in
their markets.