• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity Bean and DAO

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between Entity Bean and DAO.
and when should we use DAO and Entity Bean
Regards,
aakash
 
Rajeshwari Natarajan
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A DAO is used to basically write all data access logic. U might be reading the data from a database, flat file or any other source. U'll start with a top level DAO class and a separate DAO for each underlying data storage. The client only needs to know the methods to be invoked to get data and not the underlyisng data storage logic.
U can use DAO in conjunction with an BMP entity beans. That way u won't have to make changes in ur bean everytime u want to make changes to ur database calls.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to read the following articles -
http://java.sun.com/blueprints/patterns/DAO.html
http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic