That makes it easy to rule out annotating the entity objects with Jaxb directly. That only makes sense when all clients are using the same object boundaries. For example, if you have a canonical data model.
The question remains: do you want to use DTOs. With DTOs you are introducing a whole new set of classes that you have to look after. If all you are doing is marshalling those objects into a text document to stream over a network then it will be much easier to take a dynamic approach. For example, using a map.
I would say the only reason to go to the trouble of declaring a whole set of DTO classes is if you are going to share them with a client so that they will take advantage of static typing.
Will you share your DTOs with a client, or will you only ever use them for generating a message document?
On Sunday, 13 January 2013, Craig Silk wrote: