News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 7/1/2009 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
Is the mystery Borland suitor Serena?
Borland software is considering an offer from another company after a preliminary deal with MicroFocus. Is Serena the new company?
06/30/2009 01:55 PM EST

Windows 7 - An eBayer's dream product?
Windows 7 pre-orders can make people money on eBay.
06/29/2009 03:48 PM EST

Know thine cloud provider
Cloud computing require companies to understand compliance and regulation. Third parties will play a big role in regulated industries.
06/29/2009 02:58 PM EST

 

Microsoft Worldwide Partner Conf.
7/13/2009 to 7/16/2009
New Orleans
Microsoft

OSCON (Open Source Convention)
7/20/2009 to 7/24/2009
San Jose
O'Reilly Media

XBRL Technology Workshop & Summit
7/28/2009 to 7/30/2009
Santa Clara
XBRL US

ACM SIGGRAPH
8/3/2009 to 8/7/2009
New Orleans
ACM SIGGRAPH

OpenSource World (formerly LinuxWorld)
8/12/2009 to 8/13/2009
San Francisco
IDG World Expo


 
Most Read Latest News Blog Resources

AJAX Is No Panacea




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.


Share this link: http://www.sdtimes.com/link/29157
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading