- You have a ‘method’ in you hand.
- It hits the Db.
- It might be LOADING, SAVING, DELETING some entities according to method’s implementation.
And you need you place this method somewhere; and your option is either the Repository or the Business Logic.
Questions:
What attributes of this method makes it part of the business logic so that you place it in the business-logic layer?
If I rephrase: How do you decide if a method should be placed to ‘Business Logic’ or to the ‘Repository’ ?
Your repository should only be doing simple CRUD operations (e.g. Insert, Select, Delete etc). If it is doing more than that it belongs in Business Logic.
You can have a Service layer to do business logic which then calls out to your Repository but your repository should be ‘dumb’, doing just CRUD.