Tagged Questions

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

3
votes
3answers
216 views

Should service layer catch all dao exceptions and wrap them as service exceptions?

I have three layer Spring web app: dao, service and controllers. A controller never calls directly the dao, it does it through the service layer. Right now, most of the time if there is dao exception ...
-1
votes
2answers
121 views

Data Access Objects old fashioned? [closed]

A couple of weeks ago I delivered some work for a university project. After a code review with some teachers I got some snarky remarks about the fact that I was (still) using Data Access Objects. The ...
0
votes
1answer
165 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
vote
0answers
496 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 ...
2
votes
2answers
669 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
2answers
785 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 ...
0
votes
0answers
94 views

DAO Design with Child Objects

If I have objects that represent a hierarchy of relationships. For example: Person   Spouse     Spouse Contact     Spouse Address ...
2
votes
1answer
686 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 ...
3
votes
2answers
275 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 ...
4
votes
3answers
890 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 ...
1
vote
3answers
8k 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 , ...
0
votes
3answers
378 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 ...
5
votes
2answers
4k 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 ...
2
votes
2answers
312 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 ...
4
votes
1answer
685 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 ...
0
votes
1answer
30 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 ...
5
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 ...