users@jaxb.java.net

Multiple version handling

From: Vallamshettla, Anand <Anand.Vallamshettla_at_tgslc.org>
Date: Tue, 8 Feb 2005 17:00:19 -0600

Vallamshettla, Anand wrote:
> We have industry standard schemas that will be revised every quarter
or so. And
> most of the changes may be adding an element or making the element
optional i.e
> micro version changes such as changing from 1.0.2 to 1.0.3.
>
>
>
> In these instances, we can add support by generating classes with JAXB
2.0 with
> the new schema and etc. But the trickiest part is having to support
all the
> versions related to a major version i.e '1' in this case, which means
we need to
> support 1.0.2, 1.0.3 and may be 1.1.1 etc. In this case we would end
up with
> multiple sets of objects that represent each version.
>
>
>
> NOTE: In a given major version, structure of the document wouldn't
change.
 
What do you mean by "structure of the document"? If schemas needs to be
revisioned, something must be changing.
 
- Revision is only in minor or micro version. What I mean by
structure here is that elements from one complex will not be moved to
other complex element etc.
But the only change would be adding new elements or making exiting
elements optional. If it is just an additional element, then it would
mean adding another field. I guess this would become complex with Name
spaces are taken in to consideration as the name spaces are hard coded
in to the generated classes. :-)
 
> Is there any way in JAXB so that we can compile multiple versions of
schema and
> end up with only one set of Objects just like in XMLBeans?
 
Could you elaborate on how it works with XMLBeans? You can specify
multiple schemas and tell the compiler to coerce them into one set of
classes?
 
- I was wrong in the case of XMLBeans, it does generate separate
classes for those that have changed.
- I read it before (may be JiBX) where you could have one set of
classes for different versions of schema.
This is some what important to us as we will be converting these JAXB
objects into value objects. Every time a new minor version comes out, we
would have to write another set of converters or mapping file or etc.
 - We are just evaluating to see what can be accomplished and what
can't be.
 

 

Thanks very much for your timely response.

 

Anand Vallamshettla