InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

XML Schema Patterns for Databinding

Posted by Stefan Tilkov on Dec 05, 2006

Sections
Topics

The W3C has published a working draft of the XML Schema Patterns for Databinding specification, aimed at increasing interoperability among XML databinding tools.

Spec co-editor Paul Downey answered some questions about the spec for InfoQ and started out by separating the two main schema use cases, first as a validation language, secondly as a means of describing the expected structure and content of an XML document. The databinding specification focuses on the description use case, where some sort of agent — for example a development environment or run-time component — consumes a Schema, possibly wrapped inside a WSDL document, and uses it to map between XML and a data model, which can be to a programming language, a database or an XML alternative such as JSON or YAML.

As developers who have tried to use tools from different vendors have learned the hard way, different databinding implementations support these concepts with different quality. Paul pointed to a quote on the WG page from the Chairs' report from the W3C Workshop in Schema User Experiences which led to the formation of the Working Group:

There was significant support for the idea of a written ‘profile’ of XML Schema which would document the sweet spot for purposes of data binding, or for other specific domains. The word profile is problematic; what was meant was not a language subset, but only a definition of the sweet spot in existing processors, which would allow schema authors to get better results and better user experience when data binding tools are used, and which would tell implementors in the relevant domain which parts of schema users are most likely to expect them to support well."
In Paul's words, "the problem isn't so much that Schema sucks, or that databinding implementations suck, it's that they all suck differently." As opposed to having workarounds based on suggestions from vendors that typically just shift responsibility from one to the other, the idea of the spec is to get this topic addressed through a standards body. Quoting Paul again:
A fairly typical scenario is for a vendor to suggest changing your schema or WSDL to work round an issue with their tool, only to result in other implementations failing. We call this process a "barf dance".

The specification is unusual in that much of it is machine process-able. It defines a schema pattern using a single XPath expression and identifies each pattern with a stable URI. This enables the building of a patterns detector in the form of a Schematron schema or XSLT stylesheet to evaluate the patterns used within a description.

Questioned whether the members of the working group have actually researched and tested tools for interoperability to find these patterns, Paul replied:

BT, who I represent in the WG, has a large amount of experience with a wide range of databinding toolkits since 2001 which we have brought to the working group. We also are in the process of building a test suite which takes simple example schemas and exposes them as "echo" service operations. Firing instance documents at such a service allows us to quickly and generically evaluate a databinding implementation.
He also commented on his views about the spec's impact:
Well immediately the "Basic" patterns detector in conjunction with the WS-I Basic Profile serves as a useful quality gate when publishing WSDLs. The W3C plans to host the detector as a validation service. Going forward we really need help from developers of toolkits in publishing logs of running our test suite against their implementations. We've had a good response so far from the Open Source community, but have few vendors participating. So if you are experiencing difficulties using a databinding implementation from a big-name, you might question why they aren't involved in the Working Group! We also need help from publishers of schemas to ensure we cover their "Advanced" patterns. This will assist vendors to understand where they can concentrate their efforts in improving their tools.

Finally, Paul asked for the community's contribution to making the spec as useful for real-world tasks as possible:

Much of the value of a W3C specification comes from its open process. We are working in public and welcome contributions in the form of comments, contributed patterns, test cases and testing reports.

More information is available in the specification document and the Working Group page.

No comments

Watch Thread Reply

Educational Content

Jesper Boeg on Priming Kanban

In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.