-->
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.  [ 4 posts ] 
Author Message
 Post subject: Do we really need DAO layer when using Hibenrate objects
PostPosted: Thu Sep 07, 2006 5:52 pm 
Beginner
Beginner

Joined: Wed Jun 09, 2004 2:49 pm
Posts: 25
When using Hibernate ORM, I don't feel I need another DAO layer.
Just wondering how many of you share my feeling.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 08, 2006 5:47 am 
Newbie

Joined: Thu Aug 24, 2006 2:16 am
Posts: 4
your hibernate code would come in ur DAO layer itself...why would u need another one ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 08, 2006 11:39 am 
Beginner
Beginner

Joined: Wed Jun 09, 2004 2:49 pm
Posts: 25
Look at Spring/Hibernate integration example and you will know my question.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 08, 2006 11:55 am 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
I agree. I think the DAO pattern can be an unnecessary layer to your application when using Hibernate or other ORM tool. If your in a J2EE environment, your SessionBean can act as a DAO layer. Hell, some JEE 5 examples do exacly that.

However, it can be useful if you think you could be changing persistence architechures and the means to access you data will change as a result. Additionally, A DAO is MUCH easier to test than a SessionBean as it does not require you test it in-container. I still use DAOs for that reason alone, otherwise its just extra code in your app.

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember to rate!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.