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


   

 
 
Download Current Issue
ISSUE 2/1/2010 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
blogs tab
Visual Studio 2010 Release Candidate Available Today
A Visual Studio 2010 release candidate is available on MSDN.
02/09/2010 09:45 AM EST

Is Microsoft eyeing Office subscription pricing?
Microsoft may be preparing to offer a new Office pricing option called "union," which charges the same for cloud as on-premises.
02/01/2010 09:38 AM EST

Facebook rewrites PHP runtime
Facebook is about to open source its own PHP runtime, written from scratch for speed.
01/30/2010 08:53 PM EST

 

Events calendar tab
2/9/2010 to 2/13/2010
San Francisco
IDG World Expo

2/10/2010 to 2/12/2010
San Francisco
BZ Media

2/17/2010 to 2/25/2010
Atlanta
Python Software Foundation

2/19/2010 to 2/20/2010
Los Angeles
SCALE

2/21/2010 to 2/24/2010
Las Vegas
IBM


 
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