In computer software, a data access object (DAO) is an object that provides an abstract interface to some type of database or other persistence mechanism. From Wikipedia: http://en.wikipedia.org/wiki/Data_access_object

learn more… | top users | synonyms

6
votes
4answers
2k views

Are there any real benifits to a DAO layer?

When I first started using Hibernate I heard about all the joy of using a DAO layer. Initially it made sense for my problem: I was going to experiment with Hibernate and later experiment with NoSQL ...
5
votes
2answers
3k views

How to manage 2 DAO methods in a single transaction?

In an interview someone asked me : How do we manage 2 transactional/dao methods in a single transaction. Desired capabilities: If anyone of them fails we need to rollback both methods. Both of the ...
4
votes
3answers
696 views

SQL RDBMS : one query or multiple calls

After looking around the internet, I decided to create DAOs that returned objects (POJOs) to the calling business logic function/method. For example: a Customer object with a Address reference would ...
4
votes
1answer
663 views

DAO/Webservice Consumption in Web Application

I am currently working on converting a "legacy" web-based (Coldfusion) application from single data source (MSSQL database) to multi-tier OOP. In my current system there is a read/write database with ...
3
votes
2answers
263 views

java classes and database queries

Can someone please explain the best way to solve this problem. Suppose I have three classes Person Venue Vehicle I have a DAO method that needs to return some or all of these attributes from each ...
2
votes
4answers
653 views

Does 'consider returning Null Object' apply to a DAO read method?

I was looking for an answer to the question of what a DAO should return when a search ends up to be for an entity that does not exist. There are some generic previous questions related to returning ...
2
votes
2answers
282 views

Replacing dao layer

I am developing a series of webservices (based on spring and spring mvc). For the first time in my dev career I do plan on replacing the dao layer in the future(I have always seen it mentioned but ...
2
votes
2answers
498 views

OOP Objects, nested objects, and DAO's

Here's something I keep struggling to figure out the best solution to. I've had this problem while working with PHP and Java so it's a fundamental understanding of OOP issue. Examples are in PHP. ...
2
votes
1answer
514 views

Using a DAO to abstract our ORM from the rest of the application

We're using MySQL with Sequelize.js as the ORM. What we're wondering is whether a DOA layer of abstraction is worthwhile. Here are our options: To use the Sequelize models throughout the ...
1
vote
3answers
6k views

In MVC , DAO should be called from Controller or Model

I have seen various arguments against the DAO being called from the Controller class directly and also the DAO from the Model class.Infact I personally feel that if we are following the MVC pattern , ...
1
vote
0answers
360 views

Thoughts on refactoring a generic DAO

I have designed a generic DAO in Java and am having confusion about whether to refactor it to different design or not. PS Don't say to use already existing 3rd person framework. I know there are some ...
0
votes
3answers
347 views

Reuse the data CRUD methods in data access layer, but they are updated too quickly

I agree that we should put CRUD methods in a data access layer´╝î However, in my current project I have some issues. It is a legacy system, and there are quite a lot CRUD methods in some concrete ...
0
votes
0answers
87 views

DAO Design with Child Objects

If I have objects that represent a hierarchy of relationships. For example: Person   Spouse     Spouse Contact     Spouse Address ...
0
votes
1answer
29 views

Users and roles: Where to put queryUsersWithRole()?

I have two model classes User and Role and two managers/DAOs (UserManager and RoleManager) plus a method which gives me all users with a certain role (List<User> getUsersWithRole(Role)). In ...
0
votes
1answer
123 views

Spring JDBC Template without DAO?

I am rather new to writing applications that interact with databases, and I'm curious about a project I'm working on. I have to write a very simple web app which is going to be displaying metric data ...
-1
votes
2answers
170 views

Help with MVC design pattern? [closed]

I am trying to build a java program for user login but I am not sure if my MVC design is accurate. I have the following classes: LoginControl - servlet LoginBean - data holder java class with ...