Can a service-layer object “service” a DAO-layer object? Or is does this violate the integrity of a properly layered architecture?
e.g.,
class MyService {
}
class MyDao {
private MyService myService;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I wouldn’t do it. DAOs ought to deal with databases; services manage other services and DAOs to fulfill their use cases. It’d be better to have the service call the DAO and any other services that are required.
You risk a circular dependency with this arrangement.