Dain,

This is beautiful. This should definitely go to the documentation.
Thanks for sharing this info

I also saw quite a few postings from you in the mail archives which
were very informative. In case you remember something at the top of
your head, which you think could go into docs, please let me know.

On 6/26/07, Dain Sundstrom <[EMAIL PROTECTED]> wrote:
I just committed the last changes to convert our old Castor tree to
Jaxb2, and the resulting code is wonderful.  Take a look if you have
some time org.apache.openejb.config.sys.  Here are some notes on the
conversion:

* I started with a generated codebase using the following command:

   $ ls
   activation.jar      jaxb-api.jar        jaxb-impl.jar       jaxb-
xjc.jar        jsr173_1.0_api.jar

   $ java -jar jaxb-xjc.jar openejb.xsd

* The generated classes are very clean and easy to modify by hand as
they don't have any generated marshaling logic.  This does mean that
the startup is a bit slower due to the need to generate this at
runtime, but our schemas are tiny.

* Most of the elements in the OpenEJB tree implement the Service
interface, and actually have the same implementation code.  I was
able to create (extract) an AbstractService that each of services
extend.  Inheritance just worked... no magic.

* I was able to convert the String "content" property in our services
directly to a Properties object at marshall time with the
PropertiesAdapter I wrote.  Jaxb has a very clean properties adapter
system that lets you convert any type the XML system understands to a
non-annotated java type.

BTW, hats off to the Castor team!  Castor carried us for a long time,
and Jaxb2 was vastly influenced by the Castor team (it is effectly
Castor 2.0).

-dain



--
Karan Singh Malhi

Reply via email to