odan / slim4-skeleton

A Slim 4 Skeleton
https://odan.github.io/slim4-skeleton/
MIT License
449 stars 80 forks source link

Question: MVC vs ADR Pattern #118

Closed borgogelli closed 1 year ago

borgogelli commented 1 year ago

Hi everyone, I have to convert an old Controller class which has 20 methods which are associated to 20 routes, to the ADR pattern. Should I have to write 20 Action classes or there is an more concise alternative solution ?

Regards from Italy

odan commented 1 year ago

Should I have to write 20 Action classes

Hi! This approach might result in a larger number of classes, but by organizing your code this way, you can achieve a more modular and maintainable structure, which is one of the goals of the ADR pattern.

borgogelli commented 1 year ago

Thank you a lot