Ultimately, it depends on where you want to focus:
If XML Schema is the Most Important Thing
Then itβs best to start with an XML schema and create a JAXB model. There are details of the XML schema that the JAXB implementation (JSR-222) simply cannot generate:
- Maximum values ββother than 0, 1 or unlimited
- many faces on a simple type
- model groups
If the object model is the most important thing
If you will use the Java model for more than simple conversion between objects and XML (i.e. using it with JPA to save), I would recommend starting with Java objects. This will give you maximum control.
Blaise donough
source share