user414967
user414967

Reputation: 5325

service layer suggestions

I have some queries regarding the service layers. I have some DAOs called EmployeeDAO,ProjectDAO,etc. Now which is the best way to access these DAOs? Should I create seperate Service layers for each DAOs or create a common Service layer which will have all the DAOs. I would like to use spring here. considering loading the beans and performanche, which is good?

Upvotes: 0

Views: 133

Answers (1)

npinti
npinti

Reputation: 52195

I think that it would be best if you split things up, for instance EmployeeService, ProjectService, etc. I think it is better to break things down. Imagine if you have some methods which are common to both, so you use the same method(s) to access both the Employee data and the Project data. Now, a few months in your project, something changes to the Employee data, but not to the Project data. You will have to do a refactoring of code which, as far as the Project data is concerned, is not needed.

Breaking things down should allow you to maintain the system better.

Upvotes: 3

Related Questions