commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject Re: [digester] Digester vs xmlbean vs JAXB
Date Tue, 11 Nov 2003 22:32:34 GMT
On Wed, 2003-11-12 at 11:14, Samuel Cheung wrote:
> I have a newbie question. What are the advantages/dis-advantages between
> Digester vs xmlbean vs JAXB? My understanding is they convert XML file to
> Java Class. Is that correct?
> If that is the case, shouldn't one use JAXB over xmlbean and Digester, since
> JAXB is "standard"? 
> Thanks for any feedback.

First of all, JAXB requires you to have an XML schema for the input xml
you are to process. If you don't have one for the xml you wish to
process, then creating a proper schema can be non-trivial.

Secondly, JAXB has a "precompilation" step which generates code. This
code is dumb "data-holding" classes + parsing logic, with no business
logic. And if you ever add business logic, then your schema changes, you
have to regenerate the classes - which wipes out out business logic.

You also get little control over what the generated classes are called.

With Digester, you map data from the input xml *directly* into your
domain-specific classes, using their public APIs. No precompilation or
code-generation. Your code structure and the xml input structure are
essentially "decoupled"; the digester rules specify the mapping.

However JAXB is definitely faster, because it uses code-generation
rather than digester's heavy use of reflection. And you don't need to
manually write the digester rules which specify the input->object

I don't know anything about xmlbean.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message