Answer the question
In order to leave comments, you need to log in
Who takes out the methods associated with the AR model where?
Good afternoon, the application is below average in volume, the division into layers is hardly justified, there are methods associated with the AR model containing various queries regarding the entity, I don’t really want to pile up the model with methods, creating helpers for each model that will interact with the database is also not considered good tone. Or create a repository for each model, put everything related to requests there, and work without using services and dto, the controller will go directly to the repository, won't such an approach be subject to criticism? I don’t want to unnecessarily complicate the project, and I want to hold on to its adequate design
Answer the question
In order to leave comments, you need to log in
If it works then leave it like that, the project is small to figure it out))))
And yes, the repository (you can filter + repository) well, the wrapper service so as not to "burn" the repository in the controller.
Again, the DTO is at your discretion, if you promise yourself to use the AR model in the controller, just a class for mutating / reading fields and doing the rest of the operations through the service, then you don’t have to bother with the DTO
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question