Java Architecture for XML Binding Today the B2B environment has gone almost completely electronic, with the Internet as the backbone of B2B communication. The growth of the Internet in B2B communication has also seen the development and acceptance of XML as the standard medium by which enterprises and applications share data and information over the Internet. To ensure that applications have a common understanding of the XML data being shared, DTDs and schemas are used. The DTDs and schemas are the mechanisms that provide a set of rules to define and constrain the XML document. The popularity of XML and the complexities involved in business communication have meant that the schemas and the XML documents based on those schemas are often very complex. Therefore, a programmatic solution is required to create and consume XML documents based on complex DTDs and schemas in a cost-effective and efficient manner. The SAX and DOM APIs give you the necessary features to create and consume XML documents, but writing applications to process complex XML documents using SAX or DOM is both time-consuming and error-prone. Another drawback is that developers have to understand the nuances of XML to use SAX or DOM in an efficient manner. And, if the schemas undergo a change, it means a lot of extra work for the developers to get the application back in sync with the updated schema. Life would be much simpler if programmers could deal with XML data just as they would deal with data contained in an object instance in a program. From the Java point of view, this would mean that there should be a mechanism by which the constituents of an XML document could be represented as Java objects. This would give the programmers the flexibility to work with the XML data in the same manner as they would with standard Java objects, and then write back the Java objects as XML data. The Java Architecture for XML Binding (JAXB) is designed to provide the mechanism through which XML data can be converted to Java objects, and these Java objects can be written back as XML. NOTE The JAXB specification was still in community review at the time of this writing. Therefore, we suggest that you visit http://jcp.org/ to find out about the latest status of this specification. |