Hi James,
Thanks for the detailed response. Yes, choice is healthy. I will hope however that the coices stay limited to 1 or 2 alternatives. More than that, it will almost sound like waste of brain. I am very happy with JXPath and therefore I would think that Betwix is the tool I'd use for marshaling in future. What I really appreciate about JXPath is that it is quite smart about auto handling mapping for various types. An inconvenience of Castor is that it's virtually useless without explicit mapping. If Betwix is going to be a lot more transparent and not require mapping for most cases, I'd certainly enjoy it. BTW, when mapping is not provided, how does betwix handle circular references during marshaling? Xlink? Cheers, Ivelin ----- Original Message ----- From: "James Strachan" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Monday, April 08, 2002 10:32 PM Subject: Re: [Question] Betwix & JAXB > Hi Ivelin > > From: "Ivelin Ivanov" <[EMAIL PROTECTED]> > > Is there a rundown available on the reasons why Betwix is developing in > > paralel with JAXB? > > Good question :-) > > > > I've used Castor for quite some time and have been happy with its > > performance. > > JAXB takes the approach that a DTD (and one day an XML schema) is used to > generate beans that can parse/output the XML, then you can derive from them > to add behaviour. > > Betwixt takes a different approach, that starting with any bean, it already > has a default XML representation; then betwixt can be customized with just > the differences you want (moving elements around, adding arbitrary extra XML > nestings, renaming elements/attributes etc). Then betwixt can parse XML > (using Digester, it essentially defaults digester rules) or output XML > straight away, then customize to make it esthetically nicer XML later. > > On the list of things planned are SAX reader/writers and a DOM > implementation using betwixt's mappings, then XSLT can be used on beans > (like the Maven project does). Also I should finally get around to using > Betwixt to add a bean Navigator to the Jaxen XPath engine. Betwixt > essentially mirrors the Introspector / BeanInfo classes from java.beans but > for mapping information of beans to XML, so there's an XMLIntrospector and > XMLBeanInfo etc. > > > Both the JAXB & betwixt approaches are equally valid; JAXB is useful if you > want some beans generated from some kind of XML 'schema', betwixt is better > if you already have the beans and want to customize what the XML looks like, > or to automatically default digester rules for you, then maybe customize > things later. > > So if you're starting from beans and want nice XML then betwixt is a good > tool for the job; if you're starting with a DTD and want to write some > beans, then look at JAXB. > > Castor is kinda in the middle between them with a bit more complexity thrown > in for good measure but its got some good stuff in there. Though I always > get the impression Castor is trying to do too much together at the same time > rather than just doing one thing well, but maybe thats just me. I can't help > think of the phrase 'jack of all trades and master of none'. e.g. Castor is > JDO-like without being compliant, its kind of an O/R mapping tool, its a > reasonable O/XML mapping tool and a kinda OQL engine all thrown in together. > An impressive body of work though. > > As an aside, betwixt focusses on the mapping metadata of how beans should > map to XML, so betwixt could maybe be used to generate Castor java <-> XML > bindings - though I'm not sure why you'd want to do that ;-) > > > > Apache Axis build their own JavaBean-XML mapping and Betwix is yet another > > development in the area. > > Its on my list to investigate using Betwixt in Axis. SOAP supports various > different encodings, 1 of which (usually called the 'soap encoding') is a > well defined mapping of SOAP to java objects, so Axis probably implements > that spec. > > However for some of the other encodings (such as none where you just get > XML), then maybe betwixt could be used to map a SOAP schema to some > implementation beans. i.e. to have a flexible, customizable mapping. > > I'd certainly like try out a Betwixt based serializer/deserializer for Axis > and see if it works neatly. > > James > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
