AJAX Roundup

Recently I have been playing with various AJAX frameworks, both open source and commercial. For simple ‘update a certain portion of the page only’ type of applications you can roll up your sleeve and deal with the XMLHttpRequest (XHR) directly or use open source API’s like Prototype/DOJO to simply make the call.

The real AJAX experience is achieved when you use the asynchronus call feature provided by XHR in combination with very rich GUI widgets to truly give your users a rich user experience on the web. This is where the challenge of AJAX lies. For too long developers (including myself) have used JavaScript to do very simple tasks. Keeping in-memory state on the browser was never a design detail. I think for long we have looked at JavaScript as a simple client side scripting language. On a recent project I used JavaScript in an ‘object oriented way’ using JSON to represent objects and actively manage user data in the browser. We had another JavaScript guru who whipped out a boatload of JavaScript widgets. ¬†Hindsight being 20-20 we would have been better off with an open source or commercial framework. But 18 months back there were not too many good options. We did use the open source prototypelibrary extensively.

Getting back to the main point I do not think a lot of the developer community realize how exciting the AJAX RIA development is going to be. I consider myself an end-to-end developer but often focused on backend. The backend stuff (with Spring, Hibernate, EJB, etc) is quite mature and the web 2.0 is where the excitement is. For those who are technologists it is where you want to at least spend some time. The web developers who create HTML pages of the traditional web 1.0applications need to update their skills and approaches drastically to be successful in the web 2.0 world. Developers with OO language experience and at least basic JavaScript knowledge are very well positioned to do AJAX RIA development.

Like anything on the server side of things, the fun (or pain) aspect will be directly tied to the framework you use for AJAX RIA development. On the commercial side I looked at JackBe, Backbase and TIBCO General Interface. Each of them comes equipped with an IDE to do development. The most impressive IDE was TIBCO General Interface. You unzip the source and point your browser to one html file and voila you are in an IDE all within the browser. Pretty amazing when you realize they may have used many of their own components to build the IDE. Very similar situation with JackBe. The thing I did not like about JackBe was you need to start a tomcat instance and then point to that URL to get to your browser-based IDE. And also JackBe’s components and API’s were quite cryptic with 3 letter function names and no packaging of the various classes. Also various components were not feature rich. But I think as with any product they will evolve. As for the others, I looked at them and had mixed reactions. The real unknown to me about these commercial tools is; what will be my experience if I need to get out of the IDE and deal with the code directly. That is where open source wins.

On the open source there is DOJO and YAHOO YUI. Both are very comparable in ease of use, features and widget support. Both have nicely packaged components. By packaging I mean Java like packaging of API’s. Makes a developers life very easy. Where YUI wins outright is documentation. Its great. With DOJO I have had to spend many hours pouring through various sites to get developer help. They have a manual and an API guide but somehow not enough or not up to the mark. Checkout YUI docs and it makes any developer smile.

Then there are tools like Googles GWT and the open source Echo2 framework. Both of these allow you to build your web GUI using Java classes (like Swing). Of course the API’s are not same as Swing. But with this you can now forget about building complex JavaScript and let these frameworks generate JavaScript and also map UI events to Java code. Very nice. Though I still think this is bleeding edge and little risky. But I would be game on trying this for small projects. Personally I think in the long term this is the best approach. Will that happen who knows. Right now these API’s generate HTML and JavaScript. Tomorrow they can generate Flash content or even Swing. I think the possibilities are great. But only time will tell where this will go.

Note: I was quite amazed with TIBCO General Interfaces’ support for Web Services. Take a look at that. The IDE can parse a WSDL and allows you to drag and drop form elements directly on WSDL elements to map them together.