从许多不同的来源阅读后,我对 MVC 模式中 View 和模型应该如何通信感到非常困惑。据我了解,accepted answer of this post和 this article from Apple说两者的通信应该通过 Controller 来完成。而MVC page in Wikipedia , ASP.NET MVC page , 和 this article in MSDN显示 View 和模型之间存在直接关联。所以根据the answer in here那么,Apple 的文章所指的实际上是 MVP 而不是 MVC?感谢您的任何帮助!!
最佳答案
答案不止一种。
最终,您可以做任何适合您需要的事情。
我使用 Controller + ViewModels 连接到 View 。
View 从不使用模型。正是 Controller 给他的。
史蒂文·桑达森 (steven sandarson) 的书第 49 页对所有模型都有很好的解释
(MVC 的变化)。
关于model-view-controller - MVC中View和Model之间的通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6206523/