Java and XML: A Vital New Book
by Mike Loukides06/01/2000
Brett McLaughlin's new book, Java and XML, is arguably the most important new book on Java this year. Brett's too modest to say so himself, but he's done an excellent job of showing how XML and Java come together, and showing why that confluence is vitally important to any Java developer. Java and XML does much more than show you how to create XML documents or to call various methods in the Java APIs for working with XML. The book shows you how to build working software systems to do things like online commerce and web publishing.
XML is often described as a language that makes data portable. I like to think of XML as enabling "self-describing data," data that carries around with it a description of what it means. This is a powerful concept, because it means that applications with no prior knowledge of each other can communicate effectively using XML as a medium. With XML, it's possible to take data from a number of different, unrelated sources, figure out what the data means and how you want to use it, and generate new results that were unforeseen by the people who originally created the data.
That sounds abstract, but it's easy to come up with a concrete example: There are lots of sites on the Internet that contain recipes, usually in various textual formats. There are also sites like Peapod that let you submit a grocery order and ship the food to your house. If all these sites used XML, it wouldn't be difficult to write an application that lets you click on recipes for salads, entrees, and desserts, and then specify the number of dinner guests you want. The application could then compute the ingredients that you need, make up a shopping list, and submit the shopping list as an XML document to a grocery store. (If we had the smart refrigerators that people are talking about, it could even take into account what ingredients you already have on hand.) A couple of hours later, your order would arrive.
Don't miss our interview with Brett McLaughlin and a companion article by Brett, Java and XML: Interested Parties Apply Here, which looks at why XML has not been so easy to use from Java and tells how recent Java and XML offerings are changing things.
That's why XML is important. Why Java? Although I'm a committed advocate of Java, I resist most of the simplistic explanations for why Java and XML are a natural match. You can write programs in any language--even machine language--that manipulate XML files, which after all are simply text files. But Java does have a well developed set of tools for manipulating XML, including SAX 2, an implementation of DOM level 2, and the new JDOM API (developed by Brett and Jason Hunter). So Java currently has the best set of tools for working with XML--and they're described in Brett's book. And Java has proven its value as a language for developing large, industrial-strength applications effectively.
I've seen plenty of books that describe XML in greater or lesser detail. And I've seen a smaller number of books that describe the Java APIs for working with XML. But I really haven't seen another book that puts it all together--a book that gives you insight into how to use XML and Java to solve real-world problems, using the most up-to-date technologies (like SAX 2 and JDOM).
O'Reilly & Associates recently released Java and XML in June 2000.
-
Sample Beta Chapter 9,
Web-Publishing Frameworks, is available free online.
-
You can also look at a
Full Description of the book.
- For more information, or to order the book, click here.