Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it MVC when the view doesn't interact with the model?

I've designed an MVC (in .NET) where the View has no link to the Model. It only knows about the Controller. The traditional MVC pattern has all parts communicating with each other. In my case, the Controller is basically a mediator. This keeps any exceptions or logic out of the View. It has zero dependency on the Model. Is this no longer an MVC?

like image 361
4thSpace Avatar asked Jan 29 '09 22:01

4thSpace


People also ask

Does view interact with model in MVC?

The important thing is that the View and the Model never interact with each other. The only interaction that takes place between them is through the Controller. This means the logic of the application and the interface never interacts with each other, which makes writing complex applications easier.

How do you connect view models?

We can pass the data or communicate from Model to View by these three steps: Take the object in the action of a Controller. Pass Model object as a parameter to View. Use @model to include Model on the View page.

What is the difference between model view and controller?

The model is responsible for managing the data of the application. It receives user input from the controller. The view renders presentation of the model in a particular format. The controller responds to the user input and performs interactions on the data model objects.

Does the model or the controller update the view?

The client only interacts with the view. The controller interacts with the view and indirectly with the client to update the model. The view does not directly cause modifications in the model, but all modification requests go through the controller.


1 Answers

What you are describing is actually a subset of Model-View-Controller called Passive View.

alt text

Passive View is yet another variation on model-view-controller and model-view-presenter. As with these the UI is split between a view that handles display and a controller that responds to user gestures. The significant change with Passive View is that the view is made completely passive and is no longer responsible for updating itself from the model. As a result all of the view logic is in the controller. As a result, there is no dependencies in either direction between the view and the model.

Martin Fowler talks about it in the above link and briefly discusses other variations here.

like image 199
mmcdole Avatar answered Oct 07 '22 04:10

mmcdole