December 05, 2007

XML declarative frameworks

I am not sure who started it, but what I am going to explain here is how XML declarative frameworks are evolving in web technology. XML has brought a big revolution to web technology and it’s still making ground. AJAX brought the revolution in many ways. But the major problem was that developers had to be an expert in browser compatibilities, CSS, JavaScript and had to have really good programming skills. Those are now the old days! We have many small and big Ajax libraries that provide reusable components. But the problem was the about amount of coding required. How do we reduce UI coding involved and concentrate of the functionality? An innovative solution to this is XML declarative UIs. And it’s happening in a big way!

Many developers would have heard of Adobe Flex. It makes use of MXML to create a UI and ActionScript to do the event/actions responses. Things didn't stop there ,OpenLaszlo came up with LZX, which is declarative XML description of an application interface. I admire the OpenLaszlo library because it gives the facility to compile its code to Flash and DHTML. These two products are much mature, but there are other libraries to lookout for.

Apache’s XAP (Extensible Ajax Platform) is a XML-based declarative framework for building, deploying and maintaining rich, interactive Ajax powered web applications. The project is in ASF incubator. The framework aims at providing rich UI using XML, a generic layer on top of existing JavaScript like jQuery, Prototype etc.. So you can have any javascript library and code the UI using XAL (Extensible Application Language). The XAP maps XAL markup to specific UI widgets. An XAP DOM, separate from the HTML DOM, maintains the UI state. The architecture of XAP is explained here.

Google too is in pursuit of Declarative XML structure for defining GWT widgets. The project is in still incubator. But this framework will be only for GWT. When compared to Apache’s XAP, DeclarativeUi is not generic and have less features.

Apache and Google may be very well known, but I found a hidden treasure called ZK. ZK claims to be yet another “#1 Ajax and mobile framework”. ZK makes use of off-the-shelf XUL and XHTML components, and manipulate them by listening to events triggered by users. ZK is available for Mobiles also, so applications will work on any devices that support J2ME, without any modification to applications. ZK has come up with the ZUML which is based on XUL. This makes it more generic and is highly integrated with Java. The framework provides a huge set of widgets and functionality.ZK framework's architecture is explained here.

I am yet to try out programming using these frameworks, but looking at the architecture and documentations, I feel ZK is more superior in XML declarative UI building among the XAP and DeclarativeUi. But the concept of XAP to support multiple JavaScript libraries is a plus for it. At the same time I have not reviewed the Microsoft technologies (will look into them later). These frameworks will reduce the amount of time spent on UI design but, we still lack visual editor for all these. May be Flex has FlexBuilder, but others like XAP or ZK should be looking forward to provide Eclipse plugins where developers need only to drag and drop to design UI.

No comments :