Data Transfer Objects (DTO)
In order to reduce the dependency to persistence layer, Data Transfer Objects (DTO) are used as abstract layers that combine entity attributes and other DTO.
Since different data sources such as JPA, JDBC, No-SQL, REST, etc. may be available, an abstraction service is needed to transform the data from the data source into a DTO.
Build subsets and combinations of related sets of entities for special purposes.
Use the visibility processor to render context sensitive user interfaces from overlaid DTOs.
Don't care about transactions or whether to insert or update, DTO takes care of it.
Fill a DTO, send it to a remote system and persist it there. Or just synchronize two DTO instances of the same type.
Data Source Abstraction
Decouple database related structures from the upper layers so it is not necessary to know whether the DTO presents data from a database or from other sources.
Use the same DTO with various data sources at the same time.
Define how to access the underlying data sources and how to map the results into a proper DTO.
Abstract from concrete database dialects.
Generate code required to manage entity instances and their lifecycle.