We create many applications for developers using JAXB and continue to encounter problems that all return to a “version” mismatch between manufacturers and consumers of JAXB objects.
The process didn’t ease the pain, so I was thinking about something in accordance with the version of CORBA object management for JAXB, possibly through a mandatory final field, the values of which must match. As an added bonus, I would like to add the version value as the version of Maven # :-)
All this uses annotations, no xsd.
Thoughts?
Thank.
----- Clarification -----
Think of it as a Serializable serialVersionUID, which is added to the marshal's stream when the object is marshaled and required, and whose value is checked when the object is unarmalized.
Various validation rules can be implemented, but in this case I only want equality. If the current version of Foo is 1.1, and you send me the data for cancellation, whose version is something other than 1.1, I will refuse it.
reference
source
share