• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why we use DAO between Entity Bean and Data Base

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

What is use of using DAO design pattern between Entity Bean and Data base.
I heard that it will improve the performance , but how it is improving the performance i can not understand.

If u can explain clearly it will be great.
Expecting best explanation from any one.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
bcoz, by Using DAO we can use any database(Oracle,DB2) with minimal efforts.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ramesh Potti:
bcoz, by Using DAO we can use any database(Oracle,DB2) with minimal efforts.



Of course with Entiry Beans we can switch the underlying database without any code changes regardless of whether we use a DAO or not (at least, that's the theory).

Using DAOs between your application and the Entity Beans themselves makes sense, since then you can decide to stop using Entity beans and start using another ORM (or even a non-relational source) without too much of an impact on your code. However using them between Entity Beans and the RDBMS is an odd thing to do. DAO are there as an abstraction layer, pretty much in the same way that Entity beans are an abstraction layer. I don't see any benefit at all. I suppose if you are using Bean Managed Persistance you might want to abstact that persistance code in some way, but it sound like an over complication to me. It certainly is very unlikely to improve performance much anyway.
[ April 13, 2006: Message edited by: Paul Sturrock ]
 
murali kankanala
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ramesh,

Thanks for the reply. But i did not get the clear explanation.
I knew that DAO used between EntityBean and Database if your application is to be database independent.

Even we can do the same code that you are using in DAO , then how to do with minimal efforts.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A BMP Entity bean uses a DAO to execute database opertaions (specific to a DB like Oralce).
A CMP Entity bean typically uses internal DAO (not created by bean developer).

check out :
http://forum.java.sun.com/thread.jspa?threadID=563234&messageID=2773263

my 2 cents

:-)
 
reply
    Bookmark Topic Watch Topic
  • New Topic