On Saturday, August 23, 2003, at 06:50 am, Aaron Mulder wrote:
No one's hand-crafting XML beans. The current code uses Castor to
generate them. There's (probably) no reason we couldn't use xbeans
instead, but at the time I wrote it, the only ready option I was aware of
was Castor.
If we switch to xbeans, would you like to see the Geronimo XSDs
loaded into the same directory as the J2EE XSDs? I would think we'd want
to use a subdir in any case, just for clarity, but we may want the
Geronimo XSDs to live in the core module instead -- I have no strong
opinion.
Me neither. Keeping them together for now would make sense. We could always create an xmlbeans Maven plugin later on to make it easier to keep specific Geronimo XSDs with the modules that need them.
Though, to elaborate, the DConfigBeans are JavaBean wrappers for
the POJO XML data objects. The reason the DConfigBeans are hand crafted
is that they have to be quite UI oriented (generate and handle events,
provide property editors with pick lists, etc.), as well as being tightly
tied to DDBeans (each DConfigBean corresponds to a DDBean, where DCBs are
used for the Geronimo DDs and DDBs are used for the J2EE DDs, if I can be
forgiven the abundance of TLAs). I don't think we could auto-generate
this code without practically as much mapping information as we currently
have code.
OK I get it now :). Sorry was just trying to avoid us both doing the same thing in different ways at the same time.
However, it sounds like perhaps the DDBeans should take advantage of the xbeans XPath features, if they are a good fit.
Aaron
P.S. Does this xbeans package bear any relation to BEA XMLBeans?
Not really. I basically tried to use all the available tools out there to create 'xml beans' - beans generated from all the XSDs and capable of parsing themselves & validating themselves against XSDs.
Tools I've tried in that module are JAXB, Castor & XMLBeans. I couldn't get Castor to work at all with the full 7 J2EE XSDs. JAXB kinda worked but was a bit painful. XMLBeans worked a treat. None of the tools are perfect. I'd really prefer it if XMLBeans could make simple beans and then make XML wrapper objects to do the XPath / XSD validation; since XMLBeans is moving to Apache maybe we can patch the code generator to do this in the future.
If anyone is aware of any other tool to auto-generate beans from an XSD and perform the XML marshaling & XSD validation (hopefully with XPath too which is cool) I'm all ears.
James ------- http://radio.weblogs.com/0112098/
