XML Data Binding for the JavaTM 2 Platform aims to automatically
generate substantial portions of the JavaTM platform code that
processes XML data. Data binding applications will be small and fast,
suitable for server-side applications and other applications where
processing efficiency is paramount. And, since the Java platform is
vendor-neutral, those applications will run anywhere.
Eric Armstrong of Sun has written an XML white paper titled "Code Fast,
Run Fast with XML Data Binding," providing background information on
schemas and giving a conceptual overview of the data binding process.
It also provides an overview of the other major XML processing
mechanisms, SAX and DOM, for an understanding of where data binding
fits in the XML landscape.
The data binding specification project, codenamed "Adelard," is
currently being developed through the Java Community ProcessSM
program. The project was initiated by Sun in order to maximize the
efficiency of XML processing applications, especially those with strict
requirements for data validation.
With XML data binding, XML schema definitions (which dictate data
structures and place restrictions on data contents) are automatically
translated into JavaTM Foundation Classes. The generated classes then do the work of
parsing the XML code, building the internal data structures and
validating data contents. These classes are "lightweight" in the sense
that they carry no unnecessary functionality. As a result, data binding
applications will use a minimum amount of memory and run as efficiently
as possible. The use of data binding, coupled with high-performance
virtual machines like the Java HotSpotTM virtual machine, makes it
possible to deliver and maintain high-performance XML processing
applications with a minimum of development effort.
Sections of the white paper include:
- Background: How XML gets Processed -- Covers the two major mechanisms
for dealing with XML data and documents: SAX and DOM.
- Data Validation: A Major Requirement for Business -- Schemas play a
vital role in the world of XML data. A schema tells the database
system how the data is structured and what kinds of data are valid. The
schema definition allows for automated data checking, known as data
validation. However, while Data Type Definition (DTD) specifications
for XML allow the validation of data structure, they did not allow the
validation of data content.
- Automatic Validation Boosts Productivity -- If content validation can
be automated, as well as structure validation, then application
development times can be reduced, along with the cost of ongoing
maintenance. But the cost of doing automatic validation using SAX and
DOM figures to be somewhat higher than doing the same job with data
binding.
The Adelard project for XML Data Binding promises to significantly
improve the performance and functionality of a wide base of
server-based programs and other high-performance applications. Because
it compiles a schema into Java programming language code, it allows efficient validation of
data content as well as data structure. In addition, the resulting
applications are eminently portable.
For examples, illustrations and technical details, please visit:
http://java.sun.com/xml/jaxp/dist/1.0.1/docs/binding/DataBinding.html
[...read more...]