The short answer is for me, as Henry said that it helps reduce the link between what you publish or consume and your main data model.
This is one way to build hexagonal architecture . You can freely change your kernel model without affecting the exposed model. In hexagonal architecture, it is used to display only a small, important part of the base model.
It is also a very efficient way to process services and model versions, as several versions can be mapped to the base model.
When working with XML services, I tend to create a contracted first application, so I write XMLSchema first and then create Jaxbeans, and I really don't want my business code to be contaminated with JAxb annotations.
If you know that your exposed model will always be the same, and your application will not fall into the previously mentioned cases, so you really do not need to use DTO.
Finally, I would recommend using a framework with strong compile-time checking, like Selma instead of Dozer or Orika, because they only evaluate the display at runtime, which is weak and typical for refactoring.
source share