Is the 'C' in MVC really necessary?
Posted
by
Anne Nonimus
on Programmers
See other posts from Programmers
or by Anne Nonimus
Published on 2012-03-27T22:27:22Z
Indexed on
2012/03/27
23:42 UTC
Read the original article
Hit count: 404
design-patterns
|mvc
I understand the role of the model and view in the Model-View-Controller pattern, but I have a hard time understanding why a controller is necessary.
Let's assume we're creating a chess program using an MVC approach; the game state should be the model, and the GUI should be the view. What exactly is the controller in this case?
Is it just a separate class that has all the functions that will be called when you, say, click on a tile? Why not just perform all the logic on the model in the view itself?
© Programmers or respective owner