Click here to Skip to main content
14,640,713 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am writing a bunch of sequence diagrams and was wondering if it's okay if the Views and Controller Object lifelines call the getters methods, although they are contained in the Model.

Can you show me some examples?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

MVC is a design pattern. What you can do and what you should/shouldn't do are two different things.
First of all, one major role of the controller is to manipulate the model - thus it is normal to call model methods from the actions.
It is less common to manipulate model from the view. I suggest you don't do that. Since the views are "called/returned" by the actions, you should be able to handle all manipulation from the controllers. If you need, you can call child actions from the view using Html.RenderAction.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100