Deal of the Day

Home » Main » Manning Forums » 2003 » Bitter EJB

Thread: DAO v/s EJB

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Pages: 1 - Last Post: Oct 27, 2003 11:00 PM by: import-bot Threads: [ Previous | Next ]
import-bot

Posts: 20,296
Registered: 12/6/03
DAO v/s EJB
Posted: Sep 2, 2003 11:00 PM
  Click to reply to this thread Reply

[Originally posted by purav]

Can You Pleas let me know the difference between Data Access Object and EJB??
When we should go for DAO and when not??


import-bot

Posts: 20,296
Registered: 12/6/03
Re: DAO v/s EJB
Posted: Sep 3, 2003 11:00 PM   in response to: import-bot in response to: import-bot
  Click to reply to this thread Reply

[Originally posted by crazybob]

DAO and EJB are completely different. A DAO (data access object) abstracts the
persistence
implementation from the business logic. A DAO enables you to swap out your
persistence
implementation without impacting your business logic. You may implement a DAO
with entity
beans, JDBC, JDO, etc.


import-bot

Posts: 20,296
Registered: 12/6/03
Re: DAO v/s EJB
Posted: Oct 27, 2003 11:00 PM   in response to: import-bot in response to: import-bot
  Click to reply to this thread Reply

[Originally posted by batate]

I'd also add that many tools generate DAO+JDBC code, and many people that use
DAO use it in context with a JDBC solution.

I'd say that DAO+JDBC is useful when you have a relatively static database
model, and if your data model is relatively close to your ultimate object
model. If either of these is not true, then a persistence framework like JDO
is important for its mapping flexibility.


Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor