I’ve read conflicting things on this.
From Wikipedia:
Controller Processes and responds to events, typically user actions, and may invoke changes on the model.
It’s the word TYPICALLY that is confusing. If not just user input, then what else?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I view the controller as a Coordinator, most of my code is usually in the controller. This is where the most of branches happen. In a View or Model, most of your code is going to deal with itself (a data object doesn’t know anything about a view object). However a controller matches a data object (model) to a view object, hence my thoughts of it as a coordinator.
A general ‘test’ one can apply to their application to see if they are following MVC enough: Is is very easy to re-skin your application? (Swap out the view without re-writing a whole bunch of code).
Don’t get caught up in all the religious debates and rigid ‘rules’ surrounding MVC, a product that makes money by only following 80% of MVC ‘rules’ is better than a product that isn’t done yet and too complex to actually run right…