Why does the model directly update the view in the MVC pattern?

Viewed 2246

I've been learning how to build web applications with Laravel and Vue.js and I understand the part where the user uses the view in order to send requests to the controller which then manipulates the model. I absolutely see that flow in my applications.

What I am not so sure about is why in MVC diagrams like this one: MVC pattern diagram from Wikipedia. The model directly updates the view but in my applications it seems that the Controller is the one that gets the changes from the model and sends that to the view (via HTTP).

Is there something that I don't quite understand?

1 Answers

In this diagram view is a representation of model. when model changes view changes to represent the model. in a real MVC application controller may send model to view (this model is called view-model which is a special type of model and it may get populated dynamically by controller using back end model). Some MVC applications have two types of models a model (which may be a database for back end) and a model (called view-model which is for representation and will be send to view). For example ASP.NET MVC has this type of view-model.

What is ViewModel in MVC?

https://en.wikipedia.org/wiki/Model–view–viewmodel

Related