cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Schwarz" <saschw...@hotmail.com>
Subject RE: Recommended XML to Java binding framework for Cocoon?
Date Tue, 09 Dec 2003 03:31:40 GMT
Andrezej,

About 6 months ago I looked at JAXB and Castor. Settled on Castor for the 
following business/tech reasons:
- It wasn't clear what the licensing terms for JAXB as part of Sun's larger 
XML suite would be.
- JAXB either didn't handle polymorphism and/or substitution groups (I don't 
have my notes with me).
- Castor's SourceGenerator did a good job of generating Beans directly from 
the document XSD.
- Castor's generated code can marshal/unmarshal w/o any mapping file. 
Supports validation. Alternately, a mapping file to/from an existing object 
model is also supported.
- Castor supports polymorphic collections.

Castor can also generate a mapping file automatically or, generate an XSD 
from an instance doc. So the helper apps helped me a lot.

My development flow was from a UML design of the XSD to the data model 
(document-centric design) to object/relational model. The SourceGenerator 
allowed me to push out new code whenever the UML design changed. Is the 
generated code exactly how I'd hand code it? No, but I'm thinking it can be 
reverse-engineered back into the modeling tool (Enterprise Architect) and 
ancillary functions re-merged back into the generated code.

A downside of the generated model approach is that if you plan to regenerate 
often, I think you have to design the rest of the system to interact with 
the model through non-invasive methods (not modifying the generated code). I 
ended up using visitors to implement some operations on the data model that 
I might have edited directly into the model's source otherwise. Similarly 
extending the data model classes can only be supported if you go through a 
mapping file and don't use the generated code for marshaling/unmarshaling 
(unless you want to manually modify the generated "descriptor" classes to 
construct the extended classes in place of the generated classes).

My original plan was to use Castor for both XML binding and O/RM binding but 
OJB was more complete for my needs in comparison to Castor (but that's 
another story).

HTH,
Steve


>Anyone have any recommendations as to which XML to Java binding framework
>works best under Cocoon?
>
>I have a requirement for one to do with PDF file manipulation, and was
>wondering if there were any to stay away from, or any others that might 
>work
>better under Cocoon.

_________________________________________________________________
Get holiday tips for festive fun. 
http://special.msn.com/network/happyholidays.armx


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message