SamuelAsherRivello / rmc-umvcs

Unity MVCS (Model-View-Controller-Service) Architecture. This heavily depends on MonoBehaviours. Created by (RMC) Rivello Multimedia Consulting.
http://SamuelAsherRivello.com
MIT License
38 stars 3 forks source link

The Fat Stupid Ugly Controller #3

Open Vilyak opened 1 week ago

Vilyak commented 1 week ago

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/

SamuelAsherRivello commented 4 days ago

Great feedback.

Checkout the replacement framework here.

https://github.com/SamuelAsherRivello/rmc-mini-mvcs/