3 ms·
If you have a plethora of thin controller classes which collectively handle most of the business logic, you still have a "fat controller" in aggregate, even if
by jamesbritt 15y ago
If you have a plethora of thin controller classes which collectively handle most of the business logic, you still have a "fat controller" in aggregate, even if these controllers have limited, well-defined behavior and call out to each other.
I don't follow this at all.
Anyways, what I was getting at was, as
jarrettcoggin posted, Single Responsibility Principle. Couldn't think of the name before.
A problem I see in Rails code is that some people think you have only three places to put code: M, V, or C. Most people know enough to avoid stuffing code in the view, so they stuff code into either a controller or a model. Not quite "god classes", but demi-god classes at least.
- philwelch 15y agoIf you follow the Single Responsibility Principle well enough, you're going to end up with most of your code in model classes most of the time. My point is that it's possible (but still a bad idea) to have tons of tiny controllers, each of them still doing stuff that's better served by a model.