You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arron Bates <st...@keyboardmonkey.com> on 2003/04/05 15:54:56 UTC

RE: [OT] JAXB vs Digester

> I don't know why this discussion is happening here but I'll throw in 
> my two cents.  Hands down the best one or two way xml->java system 
> is Castor.

Wont argue with that. Very fine piece of work. But the JAXB r.i. is quite
comparable. Only thing Castor does much better is that you can get the
enumeration options. Which is awesome for automatic population of drop-down
boxes among other things. With the JAXB RI it's just a validation rule. That's
my only gripe so far.

I'm just hoping the Castor team makes it JAXB compliant some time in the
future. Would be really cool.


Arron.


> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:craigmcc@apache.org] 
> > Sent: Friday, April 04, 2003 7:15 PM
> > To: Struts Users Mailing List
> > Subject: Re: JAXB vs Digester
> > 
> > 
> > 
> > 
> > On Fri, 4 Apr 2003, Dhulipala, Kris (SCI TW) wrote:
> > 
> > > Date: Fri, 4 Apr 2003 10:51:50 -0500
> > > From: "Dhulipala, Kris (SCI TW)" <Kr...@stercomm.com>
> > > Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> > > To: "'struts-user@jakarta.apache.org'" 
> > > <st...@jakarta.apache.org>
> > > Subject: JAXB vs Digester
> > >
> > > Hi,
> > >   From what I have seen of JAXB and Digester, both fecilitate xml-> 
> > > java class/object conversion and vice-versa. So what is the 
> > > difference? When to use what?
> > 
> > A couple of very incomplete thoughts:
> > 
> > * Digester is one way (XML->Java), JAXB is two way (XML->Java
> >   and Java->XML).
> > 
> > * Digester is nice for pulling just a few things out of an XML
> >   document, JAXB typically wants you to process the whole thing.
> > 
> > * Digester rules can be calculated and constructed on the fly
> >   as you configure the Digester, and include some interesting matching
> >   rules that mean you don't always need to understand the entire
> >   document structure.  JAXB is more like DOM, giving you a tree
> >   structure to process.
> > 
> > * Digester lets you deal with dynamic sets of attributes gracefully
> >   (i.e. the SetPropertiesRule, for example); JAXB wants you to know
> >   them ahead of time.
> > 
> > As with most things, it's kind of hard to say that one 
> > approach is always going to be better or worse; thinking 
> > through both approaches for each use case is probably the 
> > best approach -- in particular, I'd implement a couple of 
> > simple use cases both ways to see which one appeals to you more.
> > 
> > > Thanks,
> > > Kris
> > 
> > Craig
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org