PDA

View Full Version : Why XForms Matter


BigBison
March 22nd, 2006, 11:51
I've been working a lot lately with mixed XML/Javascript frameworks, and curiously enough, the more complex the applications become, the more that they in fact begin to resemble ... well, XForms. You have one or more XML data stores that can represent anything from a personal schema to a description for an entire set. You have a series of bindings that determine the boundaries and secondary processing of data between components, you have event notifiers that get passed from object to object in a subscription oriented framework. All of these facets, and more, are critical pieces of the XForms space.

In point of fact, you can create some incredibly rich "web experience" applications that are mixed XHTML and XForms, and can do so in a remarkably short amount of time. These are not simply empty text fields that you lay out as you do with HTML >input< elements - XForms bears about as much resemblance to HTML forms as a Bengal tiger has to a ferret. If you go back far enough you'll probably find that they share a common ancestor (they do, in fact - a weasel-like tree dweller called a Miacis, from about 50 million years ago), but in many ways XForms is more the harbinger of a new web development architecture where the application (the web page) holds a model that either populates or is populated by various XML form elements. When the model changes, so do the form element contents. When the form elements change, so does the model. This is handled automagically in the background, using the power of XPath expressions and data bindings to create sophisticated applications.

So how does this differ from the "traditional" AJAX application? The difference comes from the nature of that automagic, which is far from being either automatic or magical in the latter context. In an AJAX application, you explicitly sit on the page load tag to grab an XML (or related) resource from the server, creating an asynchronous call that will update an explicitly defined model, then write more code that will walk through that XML model and either pass it to an XSLT transformation or run it through more DOM manipulation code in order to explicily populate the fields in question in the web page (any more explicit and it would require an X rating). You can cut this code down considerably with some carefully coded libraries, but these libraries add to the overhead of both loading and maintaining the page, sometimes significantly, and if they are not well written can also add a considerable burden to the debugging department.

On the other hand, an XForms like architecture defines XML data models, constraints, and bindings explicitly as rules given within an a declarative XML format. This declarative form works in a manner similar to that of an Excel spreadsheet. In Excel, for instance, you define both blocks that hold initial data then you have functional blocks that perform calculations either upon the initial data or a previously defined functional block. What you end up with in this kind of declarative "program" is an application where the "answer" may in fact be a lot of different pieces of information, where the only action involves the changing of one or more initial values, and where constraints will at a minimum prevent you from entering erroneous data.

Whether talking about spreadsheets or XForms, the one dominating factor in both cases in their development is the recognition that you are creating such a form in its entirety, at every single point within the application process itself. This is a fairly subtle concept, but its an important one. When you create an imperative script, at any given point in the process that script will be incomplete, perhaps to the point of being unrunnable. This means that most development requires that you create fairly complex modules, run (or compile) them, then spend time trying to figure out why you're not getting any answer coming from out of the black box. It necessitates at the beginning having a comprehensive idea about what pieces you will need to construct the application, and so places a premium on planning in environments where planning and design budgets are usually pushed to the absolutely minimum.

In a declarative model such as XForms, however, so long as your syntactical structures are intact (i.e., so long as you have clearly defined well-formedness) your model will run. You CAN, of course, design forms that do not check for valid data, so there is no guarantee with XForms (or Excel for that matter) that your model will return anything meaningful. In other words, garbage in - garbage out still applies. However, introducing constraints in such an application is also not hard to do, making it much more difficult to insert garbage in the first place.

http://www.oreillynet.com/xml/blog/2006/03/why_xforms_matter_revisited.html

The w3c standard:

http://www.w3.org/TR/xforms/

A nifty toy I may have to play with:

http://www.formfaces.com/main.html

Jimerson
March 23rd, 2006, 00:10
Very neat stuff.

Thanks for sharing :)

-Jim

BigBison
March 27th, 2006, 19:08
Part 2:

http://www.oreillynet.com/xml/blog/2006/03/understanding_xforms_the_model.html?CMP=OTC-TY3388567169&ATT=Understanding+XForms:+The+Model

BigBison
April 18th, 2006, 08:48
"For sure, people are leveraging Ajax to do XForms-like things," he said, "but I see a better world where Ajax is XForms-enabled. Since, Ajax is not a standard, but rather a collection of different UI operations. XForms, on the other hand, is a standard. It represents how form-based information is represented, collected and exchanged. For developers to use XForms as the standard and Ajax as the implementation / representation makes a lot more sense than either one replacing the other."

http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_gci1174466,00.html

BigBison
April 18th, 2006, 23:18
http://www.mozilla.org/projects/xforms

sea otter
April 21st, 2006, 15:53
Quote:
"For sure, people are leveraging Ajax to do XForms-like things," he said, "but I see a better world where Ajax is XForms-enabled. Since, Ajax is not a standard, but rather a collection of different UI operations. XForms, on the other hand, is a standard. It represents how form-based information is represented, collected and exchanged. For developers to use XForms as the standard and Ajax as the implementation / representation makes a lot more sense than either one replacing the other."


I think that's one of the most erudite, elegant things I've ever heard said about web development.

jgarifuna
May 20th, 2006, 07:37
another tech ride!

I think the form is one of those few elements that have not evolved since its introduction. Just like we are able to create magic with CSS, Javascript and the like, xForm may take us to a different new level.

BigBison
June 1st, 2006, 10:06
http://www.w3.org/2006/Talks/05-16-steven-XHTML2-XForms/
http://www.w3.org/2006/Talks/05-26-steven-XForms/

BigBison
July 20th, 2006, 05:36
2006-07-18: The XForms Working Group has released an updated Working Draft of XForms 1.1. Designed to refine and strengthen the XML processing platform introduced by XForms 1.0, version 1.1 adds several submission capabilities, a more powerful action processing facility, the ability to manipulate data arbitrarily and to access event context information, and adds numerous helpful data types, utility functions, user interface improvements, and action event handlers. Visit the XForms home page (http://www.w3.org/MarkUp/Forms/).

http://www.w3.org/News/2006#item129

BigBison
July 26th, 2006, 01:47
Now in version 1.0:

FormFacesTM is a pure JavaScript solution that utilizes AJAX techniques and can be seamlessly integrated with AJAX applications. This means that XForms+HTML can be sent directly to the browser where JavaScript transcodes the XForms controls to HTML form controls and processes the binding directly within the browser - requiring ZERO server-side processing and ZERO plug-ins. This is extremely simple to use, just insert the following tag into your XForms+HTML document:

<script type="text/javascript" src="formfaces.js"></script>

The FormFacesTM JavaScript is compatible with browsers that implement XHTML 1.0, ECMA-262 3rd Edition, and DOM Level 2 which includes Internet Explorer, Netscape, Mozilla, FireFox, Opera, Konquerer, Safari, and NetFront. To this end, the new FormFacesTM framework enables:
Cross-browser support - existing client-side browser can be used.
Server-side technology agnostic - the same forms can be used across disparate frameworks such as Java and .Net
Offline mode - user interaction does not require server round-trips
FormFacesTM is available for download, and is licensed under both a GPL and commercial license.

http://www.formfaces.com/main.html

BigBison
July 29th, 2006, 18:46
The W3C XForms working group has posted the third public working draft of XForms 1.1 (http://www.w3.org/TR/2006/WD-xforms11-20060714/). Changes since 1.0 include:

A new namespace URI, http://www.w3.org/2004/xforms/
power, luhn, current, choose, id and property XPath extension functions
An e-mail address datatype
An ID card number datatype
A prompt action element
An xforms-close event
An xforms-submit-serialize event
Inline rendering of non-text media types

The major addition I noted in this draft is support for HTTP DELETE. This is critical for the Atom Publishing Protocol (APP) among other RESTful protocols.

http://www.cafeconleche.org/#July_29_2006_39035

BigBison
August 3rd, 2006, 20:10
Understanding XForms: Events and Actions:

http://www.oreillynet.com/xml/blog/2006/08/understanding_xforms_events_an.html?CMP=OTC-TY3388567169&ATT=Understanding+XForms+Events+and+Actions

BigBison
September 7th, 2006, 12:27
Will AJAX make browser choice irrelevant?

http://internet-apps.blogspot.com/2006/09/ajax-makes-browser-choice-irrelevantbut.html

the_pm
September 7th, 2006, 17:27
Will AJAX make browser choice irrelevant?

http://internet-apps.blogspot.com/2006/09/ajax-makes-browser-choice-irrelevantbut.htmlNot as long as supporting AJAX is a user option and/or browsers exist which cannot serve their purpose using AJAX.

Actually, to be more precise, what will increasingly happen on the user side is that we will choose our browser on the basis of handy features like tabs, or task-related features like RSS readers, photo sharing, blogging tools, and so on.I'm enough of a cynic to disagree with this statement. A minority of more tech-savvy people will do this. Everyone else will continue to use whatever default they're fed. Maybe this statement stands up in a perfect world, but the world is far from perfect!

BigBison
November 2nd, 2006, 22:22
Two fresh XFORMS articles:

http://www-128.ibm.com/developerworks/library/x-xformswhy.html
http://www.xml.com/lpt/a/1678