Question

I have a sample multiple choice question of an Design-Pattern exam, namely:
A menu is in the MVC concept part of
a)Model
b)View
c) Controller d) Model&View

Some collegues and I would say c), because it's part of a control unit, but some collegues say it's b).

Could you help us with that question and the reason for the correct answer?

Was it helpful?

Solution

Option b).

Because view is responsible for all the UI logic within MVC pattern.

Controller does not care whether the user's action originated from drop-down menu or some button. For controller it only matters, that based on said action, it will alter the state of model layer.

And model layer, while possibly being the source of available options, does not know how the options where presented. Look at it this way:

Which part of triad you would have to alter to transform the drop-down into a radio-group?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top