• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

EJB versus DAO

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am attempting the 2nd part of the assignment. I have a question regarding the EJB and DAO. From what i understand, DAO is a OO-pattern, so do we use DAO when we want a persistence layer without EJB and we write our own JDBC and sql code to access the database.

Or is entity bean still required ? then where does the DAO come in ?

Appreciate any clarification.

thanks & rgds
Mandy Tan
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

DAO is used to abstract the data access to the persistence layer. This frees the client of DAO layer from knowing any implementation specific details, like using EJB or not. The decision to use DAO doesn't dictate that you must use JDBC to implement it. You are free to choose any implementation technology (for example EJB, Hibernate, JDBC) you find appropriate.

+Juha
 
Mandy Tan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

So if i intend to use DAO inside my sequence diagram, I need only show the DAO and not EJB ? Cos the DAO encapsulate the db access logic, and we are free to use EJB or hibernate in our implementation.

The assignment says it has to be J2EE compliant, but right now my sequence diagram only shows JSP/servlet, session beans and DAO. No Entity Beans yet, so i am not sure whether this will be truly J2EE compliant.

Appreciate any advice.

Thanks & rgds
Mandy
 
Oh the stink of it! Smell my tiny ad!
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic