Bill:
no matter who the expert is you are going to get different interpretations.
One of the situations where MVC is appropriate is when there are multiple views possible for the same model.
I am fully aware that this is not a must, but I don't see this situation handled in the example you referred to.
Now what if you have two Views displaying the same data, and an attempt is made to modify a record that was deleted in the meantime.
We display an error, the model is updated and then? Would you call an UpdateViews from the Controller instead of from the Model as is seen in most descriptions of the MVC pattern? And the link from the Controller to the Views opposite to what you see most of the time when MVC is used.
Bill, regarding the Exceptions thrown back to the View, I use 2 types of Exception to indicate different error situations.
Whatever goes wrong in the Controller, the Model is always updated (well, if necessary) from the Controller and the message put in the Exception is not generic but contains the message that the View needs to display (being for example "Server not found", "Record deleted", "Record already booked", ...").
Perhaps the most important thing is not to try to be "compliant" with any particular version of MVC, but instead to be consistent with the motivation of MVC. If your code is easy to read, extend, and maintain, no one will give a damn if it is a real MVC or not, -- everyone will be happy, including you, your fellow programmers who work with your code, and definitely your grader, too.
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|