|
XML, the eXtensible Markup Language, is the universal syntax for
describing and structuring data independent from application logic. This
past February, XML 1.0 became a Technical Recommendation of the World Wide Web
Consortium (W3C). From this milestone, numerous applications of XML are
popping up far and wide - and more often than not they're using JavaTM technology. We asked David Brownell, designer of Sun's Java Project X, for some perspective.
 |
 |
It seems like early on, people were looking at XML as a HTML replacement. But now it has become much more, and is capturing the interest
of mainstream business. What's going on here?
|
 |
 |
Dr. Charles
Goldfarb was an inventor of SGML, from which
XML evolved. He has an interesting way to put
this: a "MOM and POP" scenario.
The document description approach comes
from the "Presentation Oriented
Publishing", or POP, community.
HTML can do such publishing, but it
hits a wall with large collections of
content. XML was intended to expose the
structure of the information, so it can be
maintained better. But that's exactly what
the "Message Oriented Middleware",
or MOM, community of mainstream business
applications does with its own data to
ensure that the clients and servers can
independently evolve. And that community
in turn wants technologies to help it
leverage the web.
So those two communities are moving
towards each other. XML gives them a glimpse of
something that will be very valuable: one
way to represent data and either publish
it or process it. Consider a purchase
order; some folk need to print them, but
other people need to process them. What a
win to have just one representation! |
 |
 |
It seems
like people are doing a lot these days with
XML and Java
technology applications. Why do you think
this is? |
 |
 |
Well, part
of this is Jon Bosak's influence. Jon
is a Sun employee, and is the chair of the
XML coordination group at W3C. He's been
key to making XML happen; he founded and
chaired the original XML working group.
Early in the process he wrote a paper
called "XML, Java, and the Future of
the Web" which basically
suggested that XML was the data
that Java technology should be
crunching on in Web clients. The
developer community thought that
was a good idea too!
Another part is that the Java
language lets you be so darn
productive. The statistics I've
heard claim from thirty to one
hundred percent overall productivity
improvement; the reality I've seen
is at the higher end of that scale.
You really want that kind of speedup
to be on your side, particularly
if you're aiming to be early to market.
Both XML and Java technology are very web-ready, so
those web-aware XML applications are a
good fit for Java technology. Plus,
Java technology has internationalization support
based on Unicode, matching XML. |
 |
 |
Is there
some special, natural affinity between Java
technology and XML? |
 |
 |
You bet.
Java software is portable code ...
XML is portable data.
When you combine code and data in the
right ways, you get objects. So the pair
of those gives you "portable
objects" -- which are the only
really effective way to design large
scale distributed systems. No other pair
of technologies comes close. And the Web
is aiming to be such a system, so it
needs them.
By themselves, neither of these
technologies provides such a solution.
To get portable data, you need to pick a
representation that is usable in most
programming languages ... like XML, which
is structured text. To get portable
behavior, you need a maintainable program
standard that runs on most computer
systems ... like Java language class
files. Use Java and XML together, and
you get both. |
 |
 |
What are
some of the more notable or interesting
applications you're seeing developed? |
 |
 |
E-Commerce applications are big.
People expect XML to be a "slam
dunk" in this area. Electronic Data
Interchange (EDI) standards have long
needed upgrading to get Web-aware, and
XML (with its DTDs) provides an
extranet-ready way to do the upgrade. You
basically define DTDs for the documents
which organizations interchange as part
of their business dealings, like purchase
orders or shipping notices. Then the
organizations can use Web protocols like
HTTP/HTTPS to implement application
specific messaging. There are systems
out there today, using XML this way.
Those DTDs could be standardized
(vertical, horizontal) or specific to
some business process two companies have.
Supply chain integration is one area
where this kicks in, also there are home
banking and Internet shopping protocols
being designed to use XML. You can
define a workflow backbone using XML.
|
| |
"Java software is portable code...
XML is portable data."
|
|
Sophisticated Web sites are also using
XML as part of a "write once,
publish many" strategy. If the
content is represented as XML, it could
be repurposed in many useful formats.
Cataloging can be done better, and
metadata can drive content syndication
such as what the ICE team is driving. The
sort of "browser specific
format" issue you hear so much about
(including device-specific formats for
devices that may have little more than a
PersonalJavaTM platform
for the runtime environment) is just one
of many applications in this space.
And of course there's the
cross-pollination between the two of
those. Many of today's business processes
are integrated with (or synonymous with)
delivering information from a Web site.
The customer browses content and
seamlessly transitions to some sort of
business interaction, such as shopping or
customer service. People are using XML
to do that today, even lacking support
for XML documents in browsers.
|
 |
 |
Tell us about Java Project X. What's in it, and what kind of feedback have you gotten? |
 |
 |
Java Project X is the codename for a set of core XML-enabling services, using JavaTM technology. It's now available as an
early access release, which means among other things that the APIs and
functionality are subject to change. The intention is that the functionality here should be sufficient to add XML support to existing applications, and to let new XML-oriented apps be written. We want feedback about whether we got that right; so far, that feedback is very positive, and quite constructive.
The package lets you parse XML documents, work with them in memory, and
write them back out; basic stuff. The
validating parser is the fastest one
currently available, and is faster than
non-validating ones from most other
sources. People really like the speed,
and also like its level of conformance to
the XML specification. Plus, we're told
that the package is "more
accessible" than the others; it's
reasonable to learn from. For example,
just use the write() method on
any node to print it as XML.
We use two common APIs, which have
helped folk use this package out by
dropping it in to some existing systems.
The parser API is the Simple API to
XML (SAX) 1.0, widely supported in
the Java software/XML developer
community. The object model
is the Document Object Model
(DOM); think of it as a parse tree. DOM
is a Recommendation of the World Wide Web
Consortium (W3C); that's as close to a
"standard" as W3C gets. You
can get started in XML very quickly by
just parsing an XML document into a DOM
tree, or building one and then writing it
out as well-formed XML.
More sophisticated users can either
bypass DOM and use SAX directly, or
customize the DOM tree as it's built.
Those "XML Beans" APIs are
still being evolved. You can basically
say to use a given bean to represent
elements of a given type, and define
methods and state as needed by your
application.
You use those XML beans to associate
behaviors with elements. Elements are
the basic way you can extend XML;
familiar elements from HTML would be
TABLE or BLINK, but in XML you can define
whatever elements you like. A CUSTOMER
bean might be a good place to provide
methods to track purchase orders, or to
check spending limits. You can assemble
a library of beans that support a
particular XML vocabulary.
|
 |
 |
OK, so how do developers get the early access version of Java Project X? |
 |
 |
An early access version of Java Project X is available on the Java Developers Connection. JDC membership is free, and you can sign up or login as part of the download process. Enjoy! |
See Also
Extensible Markup Language (http://www.w3.org/XML/)
Managing Names and Ontologies:An XML Registry and Repository (http://www.sun.com/981201/xml/)
|