2
I have a question and wanted to hear more people’s opinion. Following the MVC, one Controller can have private methods? This doubt came to me because in my context, I have a Controller JS, and my View is a page HTML. Well, if the Controller exists to control the View, it doesn’t make much sense to have private methods, since the View I couldn’t use it, or it makes sense! Maybe I’m getting a little confused.
Which MVC technology?
– Leonel Sanches da Silva
private methods can (and should) exist, even because they support/assist public methods, even facilitating the reading of your code.
– andrepaulo
@gypsy-Morrison-Mendez, did not understand your question, sorry!
– Daniel Silveira
@andrepaulo, but these private methods should be more generic, right?! If so, would it not be more appropriate to create a Utility and place these methods?! This would take private functions out of the controller.
– Daniel Silveira
Then you will have a "sausage" in Utilities ...
– andrepaulo
@Danielsilveira I asked why, depending on the MVC technology (the language, the framework, the convention, etc.), the implementation and the approach are completely different. Answer this by detailing the various implementations would be gigantic.
– Leonel Sanches da Silva