-->
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.  [ 2 posts ] 
Author Message
 Post subject: What is the difference between DAO and ORM
PostPosted: Tue Aug 09, 2005 3:23 am 
Beginner
Beginner

Joined: Thu Jul 07, 2005 5:17 am
Posts: 30
Hi,
I am really questioning the usage of a DAO layer in a J2EE app where you have also a business service layer and a ORM solution. DAO's main purpose is to shield developers from the SQL ,seperate the logic and the data. So when using hibernate or whatsoever, you are duplicating nearly the same code.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 09, 2005 5:15 am 
Newbie

Joined: Mon Aug 08, 2005 5:10 am
Posts: 5
Yes, a good ORM solution is essentially a superset of a DAO framework. I cant think of many situations where you would want or need to layer an ORM ontop of DAO.
Sometimes an ORM is used as a DAO layer e.g. using hibernate or toplink behind entity beans I but realy dont see the point of doing that either because all good ORMs provide a cleaner more powerful and less intrusive API than entity beans.

Some IBM shops use entity beans ontop of DAOs to unify data access between widely different data sources such as CICS mainframes and RBDs but other than that DAO layers tend to used directly by the business service layer rather than behind an object model.

One of the reasons for using a DAO layer is that it maps leverages the underlying store characteristics (e.g. RDBMS join/query/batch-update) to directly perform business operations in a higly optimal manner, and you obviously lose all that if you go via another layer first. A modern ORM solutions like hibernate can do alot of that as well though with all the aditional benefits of exposing the data as a fully featured domain model.

Paul.


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