Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

What is DAO

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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.
 
rubbery bacon. rubbery tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic