rmc-umvcs icon indicating copy to clipboard operation
rmc-umvcs copied to clipboard

The Fat Stupid Ugly Controller

Open Vilyak opened this issue 4 months ago • 0 comments

Your project probably helps people a lot. But if I were in the early 2000s. I would say that this is an ideal implementation. In your implementation, I noticed that you have very fat controllers and very thin models.

Such controllers are called "Fat Stupid Ugly Controller (FSUC)".

The model must contain all the business logic. And inform "View" about parameter changes. And the controller should only send signals from the user input and give them to the model. This allows you to make the models reuse elsewhere in the application. And with fat controller, this is impossible. We will have to duplicate the business logic. Since the controller is very large. As a result, we get the "spaghetti code". The controller should not know anything about the view, but only tell the model what it needs to do.

I am not making this up, but speaking in the words of the person who put forward this term in 2008. https://codeutopia.net/blog/2008/12/06/food-for-thought-utilizing-models-in-mvc/

Vilyak avatar Oct 01 '24 20:10 Vilyak