Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between the View and Model in MVC

After reading from many different sources, I am very confused about how View and Model should communicate in the MVC pattern. To my understanding, the accepted answer of this post and this article from Apple are saying the communication of the two should be done through controller. While the MVC page in Wikipedia, the ASP.NET MVC page, and this article in MSDN are showing there is a direct association between View and Model. So according to the answer in here, what the article from Apple is referring to is actually MVP not MVC then? Thank you for any help!!

like image 737
derrdji Avatar asked Jun 01 '11 19:06

derrdji


1 Answers

There is more than one answer. Eventually you can do whatever you thing suits your needs. I use a controller + ViewModels to connect to the view. The view never use the model. just what the controller gives him.

There is a nice explanation of all models in steven sandarson book, Page 49 (variation on MVC).

like image 161
Dani Avatar answered Oct 29 '22 06:10

Dani