users@jaxb.java.net

RE: Re: Applicability of JAXB

From: Lawrence, Gabriel <glawrence_at_ucsd.edu>
Date: Thu, 23 Jan 2003 14:57:50 -0800

This message was originally submitted by glawrence_at_UCSD.EDU to the
JAXB-INTEREST list at JAVA.SUN.COM. If you simply forward it back to the list,
using a mail command that generates "Resent-" fields (ask your local user
support or consult the documentation of your mail program if in doubt), it will
be distributed and the explanations you are now reading will be removed
automatically. If on the other hand you edit the contributions you receive into
a digest, you will have to remove this paragraph manually. Finally, you should
be able to contact the author of this message by using the normal "reply"
function of your mail program.

----------------- Message requiring your approval (76 lines) ------------------
I'm trying to use JAXB... I'm new to it, so I hope this doesn't sound
dumb, but I thought I'd give you the run down.

Why I like JAXB. I didn't write the XML schema I'm trying to work with,
someone else did. Its much more complicated then I'd like, so I've got
to learn to live with it. Using JAXB I get java objects for me to fool
with. I'm used to Java objects, and it seems like a happy way for me to
deal with.

I'm disappointed that JAXB doesn't support the abstract pieces, but I
just removed the abstract definition from my schema and moved on with
life ;-)

My goal is to use JAXB to create bodies for SOAP messages and in turn on
the processing side... I'm profoundly disappointed that there isn't a
quick and easy way to plug JAXM and JAXB together... This would be my
number one complaint about it. It seems I have to create the stuff with
JAXB... Shelp it to a DOM tree and then schlep the DOM tree to JAXM
Elements... DUH. This seems to be a problem with the XML API's in
general... why is there a different kind of node in JAXM, JAXB and JAXP?
Ugh. It makes it hard to integrate these all together.

Outside of that it does seem to be working ok for me. Its still
experimentation but it looks like its going to be a good way for my to
work with the XML docs that I want without requiring people to think
outside of Java Objects...

-gabe

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Thursday, January 23, 2003 12:51 PM
To: JAXB-INTEREST_at_JAVA.SUN.COM
Subject: Re: Applicability of JAXB

> 1. One of the goals of JAXB (as defined in the spec) is to circumvent
> SAX/DOM by allowing applications to access XML data directly via Java
> objects. But the new Java APIs generated by xjc still have to be
> incorporated into your application. I'm not sure if the effort is
going
> to be less than using SAX/DOM's API since most people are familiar
with
> the standard.

Yes, you should pick the right tool and it depends on a lot of factors.
SAX or DOM has its merit. JAXB is meant to offer more choices to the
developers and we never tried to dominate the XML API.


> 2. Customization could be a very useful feature of JAXB. But why the
binding
> declarations have to be defined within an XML schema itself?

This is merely a limitation of the beta release and JAXB does provide a
way to write customizations externally.


> 3. Apparently JAXB still uses SAX/DOM underneath when
> marshalling/unmarshalling an XML doc. Conceptually, you should be able
> to do the marshalling/unmarshalling without building the DOM tree, at

Indeed JAXB RI does *NOT* use DOM as its underlying structure.


> 4. Has anyone done any comparison studies on JAXB with other similar
products? Castor, JBind, etc..

I think there were a couple of articles in http://www.xml.com/ and some
in IBM's developerWorks.



regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com