Since I learnt about MVC, I used it for every app I made (which is arguably not the best idea, but that's not the topic of this question). All of them small, 1000 LoC apps. I am using Java and Swing for the GUI.
What usually happens is this:
The view (the GUI class) reports to the controller about any GUI event (most commonly a button click) made. For example when a button is pressed, the view simply calls controller.someButtonPressed()
or controller.someOtherButtonPressed()
. It's only reaction to user input is reporting to the controller, nothing else.
This, I think, is fine and is proper MVC View implementation. The part I'm having doubts about is the following:
In the controller's someButtonPressed()
methods, it very often simply delegates to the model.
For example:
public void someButtonPressed(){
model.doTheAppropriateThing();
}
Nothing more. No 'decision making' or actual 'interpretation' of what the view reported. Very often, only simple delegation to the model.
Is it considered reasonable when implementing MVC structures and specifically controllers, to have the controller often simply delegate directly to the model in reaction to GUI events? Or does this signal that maybe I'm doing something wrong?