站内搜索: 请输入搜索关键词
当前页面: 图书首页 > XML and Java: Developing Web Applications, Second Edition

XML and Java: Developing Web Applications, Second Edition

[ directory ] Previous Section Next Section

Foreword

Hiroshi Maruyama, Kent Tamura, and Naohiko Uramoto released one of the first books that provided a practical introduction to developing XML applications using Java in early 1999. Three years later, much has happened in the XML community: Many new specifications have been released that were not discussed in the first edition, and some have been widely implemented in both commercial products and open source software, usually written in Java. Furthermore, the Java and XML communities have become more tightly integrated than they were in 1999, when many Java developers saw XML as more of a threat than an opportunity. Now the mantra "Java is portable code, XML is portable data" is repeated frequently.

The release of XML and Java, Second Edition, roughly coincides with the release of JDK 1.4, which incorporates XML technologies into the very core of Java. Sun has defined the Java API for XML Processing (JAXP), that incorporates both the de facto standard SAX API and the World Wide Web Consortium's Document Object Model (DOM) API. Also, JAXP fills in some of the gaps between these cross-platform standards to define JAXP APIs for loading, configuring, and invoking an XML parser and serializing DOM objects to XML text. Additional Java tools are being developed to assist in other XML-related tasks, such as the JAXM for XML messaging and JAXB to "compile" XML schemas into Java classes that automatically parse, validate, and serialize instances of them. Even more importantly, the basic XML functionality is automatically available to JDK and JRE 1.4 users without additional downloading or installation.

XML and Java, Second Edition, is an excellent resource for Java developers and system architects or advanced students needing to understand how to work with these new XML features being tightly bundled with Java. It assumes a basic working knowledge of XML and Java, so the experienced reader need not skip over widely covered introductory material. Furthermore, it exploits the combined expertise of the various authors while avoiding most of the discontinuity, redundancy, and inconsistency all too common in multiauthor books.

The book is organized into two parts, the first set of chapters (mostly written by Maruyama, Tamura, and Uramoto) effectively covers the core XML technologies, such as XML namespaces, SAX, DOM, schemas, and XSLT and how they can be used in Java programs. The second set primarily covers more experimental or Java-specific tools, such as application servers and EJB, messaging, data binding, and Web services tools such as SOAP, UDDI, and WSDL. In less knowledgeable hands, this wealth of material could be overwhelming, but the authors' deep expertise in these subjects allows them to handle it quite effectively, offering both concrete examples and high-level design guidance. Ryo Neyama's Chapter 10 provides a very useful overview of server-side Java XML programming using servlets, JSP, and Apache Cocoon. Yuichi Nakamura contributes two chapters on XML messaging and Web services that clearly show that Java developers have all the tools they need to participate in the Web services revolution. The principal authors contribute chapters describing the state of the art in using databases, security services, and the generation of Java classes from XML schema. The accompanying CD-ROM contains plenty of material for hands-on learning of the techniques covered in the book.

The emphasis throughout the book is on how to use the cross-platform standard tools from Java code; the authors do not succumb to the temptation to spend much time on those XML tools that exploit Java's strengths and idioms. This leaves the reader better equipped to work with XML on other platforms as well as from Java, and the knowledgeable Java programmer who understands the XML standards will have little trouble picking up the Java-specific tools.

This is not to say that the authors uncritically describe the Sun or W3C view of Java or XML. It provides an independent perspective, such as by illustrating how to use the Apache Xerces XML parser via the Java-standard JAXP interfaces instead of the Crimson parser included with JAXP. Likewise, Andy Clark's Chapter 6 on parser tricks shows how to use some of the more complex and obscure bits of XML (such as external parsed entities) effectively by using the features of the Apache Xerces parser. Other challenges we face in the terra incognita at the borders of XML and Java technology are described, and routes around the worst pitfalls mapped.

One especially valuable feature of XML and Java, Second Edition, is its treatment of the rather contentious subject of XML schemas and DTDs. XML 1.0 defines a Document Type Definition syntax describing constraints on XML structures that a validating parser must enforce, and the W3C has more recently produced a Recommendation defining an XML Schema Definition Language. The W3C schema language has not been particularly well received in the XML community, however, and several alternatives have been proposed. The International Organization for Standardization has undertaken an effort to define an international standard ISO/IEC JTC1/SC34 Document Schema Definition Language (DSDL), which covers XML DTDs, W3C schemas, the RELAX NG XML schema language, and the Schematron XPath-based tree pattern constraint language. It appears that XML users will have a menu of standard schema language options to choose from, some more appropriate than others for specific situations but none completely suitable for all scenarios.

This book has two chapters covering these subjects written by Makoto Murata, a coauthor of the RELAX NG specification and a researcher who has convincingly applied mathematical techniques to practical problems in the XML world. Chapter 9 presents information about XML schemas likely to be most useful to practitioners: it says what problems they are supposed to solve, presents the ways in which DTDs, W3C Schema, and RELAX NG address these problems, and summarizes the strengths and weaknesses of each. Chapter 16 addresses the larger principles at stake here in more depth, covering additional schema languages such as Schematron and RDF Schema. Together, these chapters provide a concise but rather profound summary of the state of the art in XML schema language theory and practice that should be of great use in guiding Java developers through the dynamic but confusing world of XML schemas.

The first edition of XML and Java played an important role in introducing Java developers to XML. The second edition not only brings this introduction up to date as Java and XML have evolved, but also shows the authors' deepening understanding of these technologies and how they fit together.

Michael Champion
Advisory Research and Development Specialist
Software AG, Darmstadt, Germany

    [ directory ] Previous Section Next Section