Background: I'm trying to separate my concerns in the application architecture the best possible way. In a nutshell:
- The requests are parsed and go to an Action
- Action decides which service(s) to call
- Services have the business logic inside
- The service returns the data to the action
- The action returns a response
When using ORM to retrieve data, does it make sense to retrieve the data directly inside the service using ORM or would you recommend abstracting the data access to another layer?
Is it good practice to directly retrieve data using ORM without an abstraction? If no, why?
Is it good practice to abstract the data access to something like a repository? If no, why?