Java Tutorial - Java Scipt : Where Do XML Tools Fit?

Java Tutorial - Java Scipt :

Where Do XML Tools Fit?


XML is already integrated into the standard edition of Java. The new APIs are geared toward basic XML parsing and transformations. The next release of Sun’s J2EE specification, version 1.4, will include many new XML specifications targeted at enterprise XML tasks. The list of specifications is rapidly growing, and it is a lot of work just keeping up with the flood. Slated for official arrival in J2EE 1.4 are the following APIs:

·        JAX-RPC (Java API for XML-based Remote Procedure Calls) facilitates the use of Java Web services based on WSDL and SOAP.

·        JAXB (Java Architecture for XML Binding) provides automated binding between Java objects and XML.

·        JAXM (Java API for XML Messaging) builds upon the SAAJ to provide higher-level XML messaging.

·        JAXR (Java API for XML Registries) is used for accessing XML registries, such as UDDI and ebXML registries.

·        SAAJ (SOAP with Attachments API for Java) implements the SOAP 1.1 messaging standard for Java.

The default implementation of these APIs is currently available in the Java Web Services Developer Pack, which can be downloaded from Sun’s Web site (http://java.sun.com). The pack is licensed under the usual Sun Binary
Code License Agreement and covers many of the emerging Web services technologies, including ebXML (Electronic Business Using XML), SOAP (Simple Object Access Protocol), UDDI (Universal Description, Discovery, and Integration of Web Services), and WSDL. These all build upon XML, but we’ll defer elaboration about Java Web services until Chapter 13.

XMLfits into the J2EE model in many areas, as the wide array of future J2EE standard APIs shows. There are perhaps too many APIs, spurred on by excessive optimism about the applicability of XML. Many of these standards will be simplified or merged, as we’ve already seen happen in the case of Web services.

Before applying XML as a universal hammer to every problem, keep in mind that XML is primarily a data interchange and interoperability technology. The edges of a J2EE application are where XML will be the most useful. As yet, there is no compelling reason to use XML throughout an application. As an anti-pattern, take the notion of using XML to internally represent business or data objects. This seems appealing because the process of binding is skipped, but the impedance mismatch is just too high to make it worthwhile. Java object representations are more compact, don’t require a conceptual shift to program, and benefit from the wealth of existing code. There are other areas where XML is marginally taking hold, such as in the case of XML databases.
Time will tell whether this is a viable niche, but historically the relational model is very good at handling data storage and querying, and XML databases are tragically similar to the hierarchical model that preceded the relational age.
There are many new XML specifications and tools. We will survey some of the more interesting open source XML tools in this chapter. With the breadth of products around, our focal point will remain on the tools that have already
proven useful in J2EE environments.