users@jaxb.java.net

Re: JAXB Lists and Trees

From: Les Hazlewood <les_at_hazlewood.com>
Date: Wed, 29 Jan 2003 00:57:22 +0000

Nick Duan writes:

> Les,
>
> Actually I was not arguing about the usefulness of a tree model. I was just
> trying to point out that such a feature may be redundant and overstretched
> for JAXB. First, the object hierarchy created by xjc maintains the tree structure of the orginal XML document. So you can traverse the object hierarchy to search for or manipulate objects. Second, using application-specific manipulation functions will be more efficient than using generic
> tree functions since your application has the complete knowledge of the object hierarchy. Third, creating and maintaining a tree is going to be
> very very expensive, and in JAXB's case, the effort is even more than
> SAX/DOM because you have to make the tree and your object hierarchy in sync.
>
> I guess without a specific use case, it is hard to see the added values of
> a tree model interface in JAXB. The most common applications of using JAXB
> I've seen is creating configuration objects from XML files. This type of
> apps doesn't require tree-manipulation/search functions. What
> type of JAXB apps are you thinking of?
>
> Nevertheless, I don't believe the current JAXB spec is perfect. I think
> one major limitation of applying JAXB in applications is the dependency of
> object APIs on XML schema. Maybe a tree model interface is indeed necessary in order to decouple such dependencies. But this is certainly
> out of scope for this discussion.
>
> Thanks!
>
> ND

Thanks for the reply Nick, I appreciate it. I hope I didn't come off
percieved as "arguing"...on this end I assure you I was taking more of a
"debating" stance :) Regardless, I always appreciate input and explanations
regardless if I agree with them or not. Stimulating discussion helps make
API standards flexible and well-planned, instead of just implementing every
feature request that is submitted.

Thanks!

Les Hazlewood

P.S. The current JAXB spec isn't perfect, but it is definately well-thought
out and a wonderful addition to Java's XML processing. Like any maturing
product, I'm sure any kinks will be worked out as time continues. I know
the Sun implementation developers and the JAXB standards body don't get much
appreciation (do we developers EVER get much appreciation?). So, thanks for
all the hard work you folks put into this project, it is sincerely
appreciated.