Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

What is DAO

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

Can any one explain DAO design pattern with example? (please dont give me the urls by searching google)

Does it comes under creational, behavioural or anyother... ?

In my project, i have created a class with hibernate stuff, Does that class becomes dao?


Thanks in advance..
Shiva
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shivakumar paka wrote:

Can any one explain DAO design pattern with example? (please dont give me the urls by searching google)



Why not? The examples are already available isn't it? If you haven't understood those examples, then feel free to ask specific questions.
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shivakumar paka wrote:Hi All,

Can any one explain DAO design pattern with example? (please dont give me the urls by searching google)


What is the difference between giving a web (can be search by Google), and explaining here?
 
shivakumar paka
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Sorry if any one misunderstood my words.

I am bit confusion about DAO design patterns.

1) Does it comes under creational, behavioural or anyother... ?

2) if i write a class with database related stuff, does it mean i followed DAO design pattern?

Please clarify....

Thanks...
Shiva
 
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
Have you read this? It's a fairly comprehensive explanation.
 
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi shivakumar,

1) Does it comes under creational, behavioural or anyother... ?


DAO represents a specific way of handling the challenge of an application dealing with multiple type of storages (diff type of databases).It provides us a way to implement a loosly coupled system, in which changes to the data access layer would not have any impact in the code of other layers.

2) if i write a class with database related stuff, does it mean i followed DAO design pattern?



Not exactly, In DAO design pattern, there must be at least three classes.

1- Data Access Object, which will encapsulate the way of communicating with the database.
2- Application layer which would require the data to be retried or persisted in the database to fulfill any specific need.
3- A transfer object, which will be a pojo. we will populate it in the Data Access Object class and make it accessible to other layers.

In such a way we get the benefit of loose coupling. In this case, change (change of database, or way of accessing) in the data access layer (1st object) does not require any corresponding change in other layers(2nd or 3rd object).

I hope this would clear your doubt.
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic