Wednesday, October 17, 2012

JAXB vs XMLBeans



Both are JAVA to XML mapping tools.

Both XMLBeans and JAXB produce Java models that make it easy for developers to interact with XML.  XMLBeans produces a set of Java interfaces that are backed by implementation classes. The JAXB model however is annotated POJOs which has the following advantages:
  • JPA annotations could easily be applied to the JAXB model enabling the model to be persisted in a relational database.
  • Once generated the JAXB model could be modified to handle changes in the XML schema, the XMLBeans model would need to be regenerated.
  • Starting with Java SE 6 no additional compile/runtime dependencies are required for the JAXB model. 
  • There are multiple JAXB implementations available:  EclipseLink MOXy, Metro, Apache JaxMe, etc.
  • JAXB is the standard binding layer for JAX-WS (SOAP) and JAX-RS (RESTful) Web Services

No comments:

Post a Comment