0

We all know that in a layered backend architecture we have the Controller (or view) > Service > Repository (or Manager)

The Repository part is the part that retrieves and updates the DB.

But now that we have ORMs that are fairly advanced, does the manager/repository part still relevant ?

I know everywhere that it's the best practice but I fail to find an actual use case where really we need this layer too.

To give an example, I'm working with Flask and SqlAlchemy on a project and All the "manager" files are just functions that call an SqlAlchemy Query. Had the same question before when working with Laravel.

Dany Y
  • 133
  • 5
  • See also: [If Repository Pattern is overkill for modern ORMs (EF, nHibernate), what is a better abstraction?](https://softwareengineering.stackexchange.com/questions/313188/if-repository-pattern-is-overkill-for-modern-orms-ef-nhibernate-what-is-a-be) – Doc Brown Feb 17 '23 at 15:01
  • and [Why shouldn't I use the repository pattern with Entity Framework?](https://softwareengineering.stackexchange.com/questions/180851/why-shouldnt-i-use-the-repository-pattern-with-entity-framework) – Doc Brown Feb 17 '23 at 15:03
  • Thank you! I think I was using the wrong search terms because i wasn't finding anything :D – Dany Y Feb 17 '23 at 15:08
  • "orm repository is:question" worked well for me (here on swe.se), returned 114 results. Note the answer to these questions are not a clear "yes or no", it depends also on the kind of ORM you are using and if you think that for your specific project coupling to a specific ORM is fine or not. So what you wrote here *"I know everywhere that it's the best practice"* looks like you are badly informed, there is no "best practice" which says "always use a repo", and also none which says the opposite, – Doc Brown Feb 17 '23 at 15:25

0 Answers0