XRX and Context Delivery Architecture

By Dan McCreary
November 6, 2008

I am seeing more discussion about organizations that want to have a much higher degree of customization for their internal applications. My customers want to create not just one client web form but they want to create a family of forms that all have slight variations. And the variations must frequently be generated from table and rule-driven sources.

With the XRX architecture, the file that creates the client application XForms file is frequently generated by an XQuery. A master XQuery generates a form template and many of the sub-sections on the form (list of required elements, datatype binding rules, code tables, conditional view rules etc.) can also call other smaller sub XQuery scripts.

When we create a form dynamically through auto-generation we usually know the id of person who is filling out the form and we can use an XQuery look-up service to see what roles that person has, and what departments, projects and groups they are in. We can also use context such a what day of the week is, what prior actions of the users have taken, what their preferences are, or their purchase history to determine the behavior of the form. These factors generate what is called the "Context" of the interaction and in the past it was one form for all contexts. With XRX you have a lot more control about using context to customized the form.

For me the big win of using context is that I have fewer XForms applications I have to create and maintain. I really look for similarities between forms and try to segment parts of forms into reusable scripts on the server.

With XRX and automatic form generation we can take advantage of the context to quickly customized the form based on the context of the situation. The Gartner Group calls this architecture a Context Delivery Architecture or CoDA and although they say it will not be a mainstream technology for a few years, they are not shy about recommending that organizations start pilot projects that are context aware. Gartner defines CoDA as:...an architectural style of business software that builds on service oriented architecture (SOA) and event-driven architecture (EDA) interaction and partitioning styles, and that adds formal mechanisms for the software elements (that is, services) to discover and apply their context in real time....To me that sounds a lot like XRX and auto-forms generation. Let me explain why.

When we use most native XML databases, the moment you save an XQuery file, the REST URL for that XQuery becomes a new XML web service. So with the XRX architecture, many of the components of an XForms application are being auto-generated by XQuery services.

There are a couple of misconceptions about XForms auto-generation that I think need to explain. First of all you don't always have to generate the entire XForms application from an XML Schema file on your first day. You can start small and just create a simple XQuery that generates the instance document that is used to load the code tables used for selection lists. You can then slowly evolve to a more complete XForms application that automatically changes behavior when your XML Schemas change. Getting a list of the elements in the schema that have a date type and generating a bind to the xs:date datatype is another small step you can take.

How do you get started with CoDA? First look at your existing forms and start to look for common elements that all users need. Keep those in a universal form generate template XQuery. Then look for areas that are specific to one or more groups. For example does every selection on a selection list relevant for all contexts? Then start adding URL parameters to the XQuery scripts that generate these forms. Use the {if then() else()} structures in XQuery to conditionally include elements in a form. Use the binding rules to hide specific views if that view does not apply to that context. Start small and then go after the more complex functions. Your users will reward you with shorter learning curves for new applications, more accurate data and more timely updates when their forms are easier to fill out and less confusing to learn.

You might also be interested in:

News Topics

Recommended for You

Got a Question?