xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett D. McLaughlin" <new.insta...@gte.net>
Subject Re: JDOM and Thank You :)
Date Thu, 27 Apr 2000 17:09:53 GMT
Mike Pogue wrote:
> 
> Could somebody who was there summarize how it differs from
> JSR031 (Java Data Binding)?

Sure... as the author, I suppose I'm qualified ;-)

JDOM is not about data binding.  It's also not about extending,
wrapping, or anything else related to DOM.  It doesn't implement any w3c
interfaces, as we believe that DOM is bloated and not useful in 80% (if
not more) of the cases you want to use it in.

JDOM is an /alternative/ to DOM and SAX.  It provides a fast,
Java-optimized method of reading, writing, and manipulating XML.  (Btw,
the PowerPoint slides just went up on the website - check
download/docs.  PDF coming in an hour or so).  DOM is trying to be a
cross-platform, 100% accurate representation of an XML document.  We
don't believe that in most cases, Java developers need that.  THey want
an intuitive, usable means of accessing XML data.

For example:

<dom-code>
  // This does *not* work, even though it is intuitive
  String elementValue = element.getValue();
  // This works (most of the time!)
  String elementValue = element.getFirstChild().getValue();
</dom-code>

That is ridiculous for a non-XML guru, non-tree-guru, Java programmer. 
What is intutive is:

<jdom-code>
  String elementValue = element.getContent();
</jdom-code>

Boom.  I'm done.  No casting, no anything (many more examples are in the
slides and code).

However, in reference to Ray, we are completely operable with DOM and
SAX.  You can build a JDOM Document using DOM or SAX (in a completely
vendor-neutral way, something not even JAXP offers today except for DOM
Level 1), and you can output to DOM or SAX.  But the idea is why deal
with those APIs yourselves, when you don't have to?

We solve that problem by completely uncoupling input from use from
output.  You can get and send data to other components in any way you
wish (including non-XML formats), without losing out on standards (until
everyone goes JDOM ;-) ); but in the middle, save yourselves some
headaches, and take a look at JDOM.

http://jdom.org

-Brett

> 
> Mike
> 
> Ray Cromwell wrote:
> >
> > Could you summarize at a 30,000ft level what it does and why it is
> > needed? I tried going to the web site, but there were no specs.
> > Browsing the JavaDoc gave me the impression it's intended to allow
> > I/O of XML from storage other than just text.
> >
> > However, one thing concerned me was that the JavaDoc didn't say
> > that their versions of Node, Element, et al, implemented the
> > org.w3c.* interfaces. IMHO, any API that doesn't atleast implement
> > the w3c interfaces is dead-on-arrival.
> >
> > Building at a higher level on top of DOM, extending it, wrapping it,
> > etc I can see, but I wouldn't use an API that didn't atleast give
> > me a DOM interface when I needed it. Interoperability is far more
> > important than syntactic sugar.
> >
> > Just my two cents. I'd appreciate a summary of it, since the web
> > site doesn't explain much.
> >
> > -Ray
> >
> > Ray Cromwell
> > MsgTo.Com, Inc.
> > ray@MsgTo.com
> >
> > general@jakarta.apache.org  wrote:
> > >
> > >I've spent a nice evening listening to Jason Hunter and Brett
> > >McLaughlin's talk at the Mountain View Java User's Group about their
> > >idea of JDOM.
> > >What's JDOM? A smarter way (designed and specifically optimized for
> > >Java) to handle XML data.
> > >Since I really enjoyed their talk (trying - unsuccessfully - to play the
> > >devil's advocate for the whole evening) and I think they come up with a
> > >good API, I would suggest to all those interested in dealing w/ XML data
> > >and DOMs to take a look at <http://www.jdom.org/> and to help those two
> > >out with some feedback (and maybe some code? it's not that hard?).
> > >Have fun :) :)
> > >
> > >       Pier
> > >
> > >--
> > >----------------------------------------------------------------------
> > >pier: stable structure erected over water to allow docking of seacraft
> > ><mailto:pier@betaversion.org>      <http://www.betaversin.org/~pier/>
> > >----------------------------------------------------------------------
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: general-help@jakarta.apache.org
> > >
> >
> > ----------
> > Message To Spammers -- Game Over!  Get spam-free email at http://www.MsgTo.com

Mime
View raw message