The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[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 (20211) [Avatar] Offline
#2
Re: DAO v/s EJB
[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 (20211) [Avatar] Offline
#3
Re: DAO v/s EJB
[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.