-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Design issue (POJO and DTO/VO)
PostPosted: Thu Aug 03, 2006 11:20 pm 
Newbie

Joined: Thu Aug 03, 2006 11:18 pm
Posts: 5
I am using struts -> Java Object (business Tier, e.g. Spring) -> Hibernate.

General practice for sendnig data to DAO is through DTO/VO for coarse grain data transfer. With hibernate we have POJO which is same as DTO. Is it good practice to use POJO for data transfer from presentation tier to Hibernate DAO, that means web tier will instantiate the POJO class, populate the POJO object and send it to DAO for persistence.
Or, shall we create separate DTO and separate POJO class ???


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 11:41 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I use the same classes for both. I can't think of a reason not to. If there's a problem due to CGLib enhancements, etc., you can always copy the fields from a DAO object into another object of the same class, effectively making it a DTO object.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 17, 2007 6:07 am 
Newbie

Joined: Tue Nov 29, 2005 11:20 am
Posts: 9
On the same lines, I have another question. What about the return route i.e from DAO to webTier. Is it recommended to bring over the hibernate POJOs or to copy over the values to similar POJO and send it back for UI display, so that we can work in a detached mode?

Can someone give best practices and design guidelines on the same.

~H


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.