File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DTO Assembler pattern

 
Miguel Cardenete
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the DTO Assembler pattern in my project to copy data from DTO to hibernate entities and vice versa.
When I copy values no problem. The problem arises when I have to establish relations based on the ID (from FKs) that represent
relationships within the DTO. This makes the DTOAssembler methods have to be transactionals and that also have to inject
DAOs within DTO Assembler,is it a good practice?. The other option would be to copy only primitive values
within the DTO Assembler and establish relationships within the Services, there are transactional and use DAOs.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic