AJAX does not compete with XForms !
I've read and heard several time things like "XForms is not ready, let's use AJAX", "Why use XForms instead of AJAX?", "AJAX is simpler than XForms", "Let's do AJAX now and XForms later", etc.
The most important point in AJAX is the capacity of delivering very reactive and dynamic web applications to the user. And for developer, it allows to think web applications as applications and user interface not as chain/flow of HTML pages.
XForms is a new standard authored by the W3C that aims at replacing HTML forms and... a lot more ! :-) Basically, it's a new XML format to create any forms. Not just plain forms, actually, but highly dynamic forms (for example, a calculator) with style and fancy graphics. XForms uses other W3C standard like XHTML, XML Schema, XPath, CSS and SVG.
XForms offers a model to create active forms, where field can react to event and communicate each other. It becomes easy, with this model to disable the whole form when clicking on OK or activating a field when another field becomes valid, or even add lines to a "grid-like" form clicking on a button. In short, XForms allows to create very active and inter-active form-based UI.
I won't explain XForms in detail here... the important point is that XForms rocks! ;-) More details can be learned from the W3C XForms page.
So, XForm or AJAX?
Well, both technologies (if we can say technology for AJAX) can provide highly active forms. But I think they don't compete. XForms is usefull for forms and UI form-based. AJAX is just about interactive UI. The crucial advantage of XForms over AJAX for forms management is its platform independence. XForms can theoretically run on any platform (not only a web browser), while AJAX is limited to the browser.
Let's imagine a web application that can also be used from rich client (using, let's say Eclipse RCP ;-). Eclipse could run the form and communicate with the server. The form itself could look list any other form of the client system. XForms could with this approach provide a convenient format to integrate deeply web and desktop (rich) applications, blurring the limit between pure web applications and pure desktop ones.
I really think that we should use XForms as much as possible for all forms of our web applications and use AJAX for the rest of the UI in the browser.
(Post originally written by Eric Barroca on the old Nuxeo blogs.)
Category: Product & Development