We have a medium sized Java server that has data flowing in the following way:
SQL Database -> Data Layer -> Business Layer -> XML Serialization
It’s important to note, that the data model mostly does not change between the layers. Yet I have been told that having a single data model used as:
SQL Database — (IBATIS) -> Model -> convert the model to XML – is not a good idea, since schema changes mean changes in the model and then change in all layers in the application. And XML changes also mean the model has to change.
So is it recommended to have two object layers in this case? 1) Business logic data layer that the business schema maps to using IBatis. 2) XML layer that JAXB uses to convert to XML.
Note: I lead EclipseLink JAXB (MOXy), and EclipseLink provides both JAXB and JPA implementations.
I recommend using one data model that is mapped to XML via JAXB, and to the database via JPA.