DEV Community

Discussion on: Clean Architecture with Laravel

Collapse
 
emperorkonstantin profile image
Konstantin Anthony

I'm curious how you'll mitigate class AppServiceProvider bloat?

Also, isn't creating so many classes for every CRUD single operation a bit much? I think more thought should be lent here, but I've yet to read the Clean Architecture book, so I would like to hear your thoughts.

Collapse
 
bdelespierre profile image
Benjamin Delespierre

Hi @emperorkonstantin , thanks for your message 👍

On real projects I use many bounded contetxts and I create service providers for each of them.

Also, a use case is much more than a part of a CRUD and, on large scale projects, deserves a lot more attention. I don't believe most apps are CRUD, despite the apparences, especially in the early days of the project. but if it's indeed the case and what you have is a genuine CRUD app then 1. why are you using Laravel instead of a serverless solution like Firebase, which would make the CRUD operations for you and 2. a CRUD is little more than a scaffolder to reach the database layer from the view, it's very simple and doesn't need Clean Architecture.

Despite what is often say about CA, I don't believe it should be applied everywhere. It's indeed complex and involves a lot of abstraction, which is not for every project nor for every team. As an architect, it's you responsibility to make those tradeoffs.