This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB and other Java EE Technologies and the fly likes DTO Assembler pattern methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "DTO Assembler pattern methods" Watch "DTO Assembler pattern methods" New topic
Author

DTO Assembler pattern methods

Miguel Cardenete
Greenhorn

Joined: May 31, 2011
Posts: 5
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.
 
Don't get me started about those stupid light bulbs.
 
subject: DTO Assembler pattern methods