Adelard, one year later - JavaWorld
Tutorial Details:
Adelard, one year later
Adelard, one year later
By: By Todd Sundsted
Sun's Adelard is a robust alternative to SAX and DOM
erhaps coincidence causes the paths of Java and XML to cross as often as they do. Or perhaps it is their linked paternity (James Gosling, of Sun Microsystems, fathered the Java programming language, and Jon Bosak, of Sun Microsystems, fathered the Extensible Markup Language). Whatever the reason, their intersection gives rise to powerful technology. Adelard, the code-name for Sun's XML data binding technology, is an excellent example. Mark Reinhold, senior staff engineer at Sun and architect of the Adelard project, talked about Adelard during a Thursday afternoon session at JavaOne titled "Adelard: XML Data Binding for the Java Platform." He described its status, hinted at its performance relative to existing technologies, and shared some of the insight he and his team gained from designing and implementing this exciting technology.
XML data binding in brief
Data binding establishes two-way mapping of XML documents to Java objects. Adelard will provide the tools necessary to transform an XML schema into one or more Java classes. These classes will make the job of building XML-enabled Java applications easier by hiding the complicated transformational machinery from the eyes of the developer in much the same way that Remote Machine Invocation (RMI) hides its networking machinery.
Adelard is an alternative to existing technologies like Simple API for XML (SAX) and Document Object Model (DOM). These technologies, while useful, operate at the level of individual elements and attributes. The application code must implement the bridge from these low-level components to business-level entities. Adelard, on the other hand, will map XML documents structures directly to business-level objects.
Adelard comprises two integrated parts: a binding framework and a schema compiler. The data binding framework supports the transformation of XML documents to and from Java objects. The schema compiler translates a schema into a set of related classes. These classes use the facilities provided by the binding framework.
A tighter focus
Over the last year, both time and experience conspired to narrow, and sometimes redefine, the scope of the technology being developed.
JSR-31, the Java Community Process document that initiated what would become Adelard, left open the question of exactly which schema languages the compiler should support. It did suggest that the W3C's emerging XML Schema language would "almost certainly" be worth supporting, and that others such as Document Definition Markup Language (DDML), Schema for Object-Oriented XML (SOX), and XML-Data might also be given consideration. Document type definitions (DTDs) appeared almost as an afterthought.
Circumstances dictated the opposite. First, W3C's XML Schema specfication isn't finished yet, and Reinhold and his team wanted to get something useful to developers without waiting for the W3C to complete their work. Second, DTDs, despite their limitations, provide schema support for almost all existing XML applications that need such support. Consequently, the first version of the schema compiler will support DTDs. Other schema languages will be supported as demand dictates.
The scope of the project narrowed as well. The original plans described a general purpose marshalling framework that could be used for applications beyond XML data binding. Since much of the effort required to build such a general purpose framework was outside of the scope of the project, this goal was eventually dropped. The current framework is no longer even called a "marshalling framework" -- it is now referred to as the "binding framework." The binding framework is tightly integrated with both XML and data binding.
Some new ideas
During the course of design and implementation, new possibilities surfaced, some of which provided real value.
Figure 1. The original code generation model
In the original design illustrated in Figure 1, the schema compiler accepted a schema as input, and applied a fixed set of heuristics to the schema to create Java classes. A developer could use the classes as is, or customize them by extending them before using them in an application. This approach lacked flexibility. No fixed set of heuristics could generate code that was perfect for all situations. What's the best way to model element content, for example? In some cases, you want to transform the element content into a full-blown class. In other cases, you want to transform it into a string.
Figure 2. The current code generation model
In order to make code generation more flexible, it had to become more customizable, resulting in the model illustrated in Figure 2. The heuristics were pulled from the schema compiler and an XML-based binding language was developed for creating a binding schema. Both the source schema (the DTD) and the binding schema became inputs into the schema compiler. The source schema describes the structure of the XML business-level information. And the binding schema describes the program-specific information that drives the generation of the Java classes from the source schema.
Even better, the removed heuristics weren't discarded. They were integrated into a separate tool. This tool creates a basic binding schema from a source schema. This basic schema can be used as is or customized further.
The best news of all
The best news of all came in the form of performance information. It turns out that current benchmarking indicates that Adelard is both faster than SAX and easier on resources than DOM. This is clearly a win for those of us building enterprise and e-business applications.
The problem with SAX and DOM is that they are both general purpose solutions to XML document processing. SAX, knowing nothing of the rules that govern an XML document's structure, must be prepared for anything. It must watch for and, if directed, generate events for every possible XML feature that an XML document may provide.
DOM, on the other hand, needs to be able to model every possible well-formed XML document. Therefore, DOM classes contain features that many XML applications never use.
Because Adelard knows about the schema, it can optimize the generated classes to support only those features necessary for the schema in question. It can get rid of support for unused XML document features.
The goods
Of course, none of this means anything if we can't get our hands on the goods. According to Reinhold, the public release of the specification and an early-access implementation should happen sometime in the third quarter of 2000. The first customer shipments will happen in the first quarter of next year.
This page formated for crawlers and browsers that don't support scripts and tables.
Home
EZone
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Adelard, one year later - JavaWorld
View Tutorial: Adelard, one year later - JavaWorld
Related
Tutorials:
XSLT blooms with
Java
XSLT blooms with
Java |
Will Big Blue
eclipse the Java
tools market?
Will Big Blue
eclipse the Java
tools market? |
Transform data into Web applications with Cocoon
Transform data into Web applications with Cocoon |
Yes, you can secure your Web services documents, Part 2
Yes, you can secure your Web services documents, Part 2 |
Sort it
out
Sort it
out |
good
design pattern
good
design pattern |
Nice
widget
Nice
widget |
CalendarComponent
Java Calendar Component V 1.0
|
Using CachedRowSet to Transfer JDBC Query Results Between Classes
Using CachedRowSet to Transfer JDBC Query Results Between Classes
The Java Database Connectivity (JDBC) API provides developers with an interface to a SQL database server, such as MySQL or Oracle. Central to any JDBC application is the java.sql.ResultS |
Introduction to Tag Unit
Getting Started
For the purpose of this article, let's say that we would like to test the core taglib from the Jakarta Taglibs implementation of the JSTL, a taglib that many people will be aware of and have experience with. Assuming that you already have |
A Rendezvous with Java
A Rendezvous with Java
During WWDC this year, Apple released Java source for Rendezvous. You can now write Java applications that can call on a Rendezvous service discovery on Mac OS X, Windows, and any POSIX system using code supplied by Apple. Apple in |
Java Servlets: Design Issues
This article covers the principal concepts associated with servlets. This article examines some of the design issues, and offers some guidelines on the applicability of Java servlets for web based application development. |
Unweaving a Tangled Web With HTMLParser and Lucene
In this article I'll show you the basic technique in building a search engine using two powerful Open Source products: HTMLParser and Lucene.
|
JavaRSS.com 2004: Review of the Year
A look back at the major events of 2004 in Java. |
Proximity Communication: Young Inventor Speeds Chip-to-Chip Communication 100-Fold
Proximity Communication has propelled Dr. Robert Drost into the spotlight. This past year, he was named one of the world's top young innovators. The Wall Street Journal honored his work and a Sun team with top honors for creating a technology that industr |
Your homepage for Cheapest domain name registration, Domain Forwarding Services, Web Designing | Roseindia Domain Regist
Your homepage for Cheapest domain name registration, Domain Forwarding Services, Web Designing | Roseindia Domain Registration
DOMAIN REGISTRATION SERVICES
Roseindia.net is the leading provider of cheapest Domain registration services in India. |
Domain Registration Guide
Domain Registration Guide
Domain Registration Guide
What is Domain?
Internet is the large network of computers. On the Internet there should be some way to identify the computers. Domain name is the solution for this. Domain Name is the unique |
What is Web Hosting
What is Web Hosting
What is Web Hosting?
What is Web Hosting?
If you have a company and want web presence than you need a website. With the website any one from the world must be able to view your pages, images etc.
Website is actually a |
News: World Records Broken with Sun Studio 10 Software and the Solaris 10 OS
Sun submits new performance world record for Sun Studio 10 compilers and the Solaris 10 operating system. |
VolatileBufferedToolkitImage Strategies
Ever wondered what kind of image to use in your application? Or what method to use in creating it? This article attempts to address this challenging topic. |
|
|
|