model-view-controller - MVC中View和Model之间的通信

标签 model-view-controller view model communication

从许多不同的来源阅读后,我对 MVC 模式中 View 和模型应该如何通信感到非常困惑。据我了解,accepted answer of this postthis 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/

相关文章:

javascript - 将选定的记录加载到模态窗口

javascript - 我可以使用新的 'controller as' 语法将 Typescript 类用作 AngularJS Controller 吗

jquery - 从客户端检测到潜在危险的 Request.Path 值

swift - 如何将图像放置在 View 的中心?

angular - Typescript 中接口(interface)和类的区别

javascript - AngularJS 不处理 JSON 引用

c# - 在新任务中打开另一个 View WPF caliburn.micro c#

iOS 添加顶栏作为 subview

node.js - 如何在nodejs中 'require'数据库模式

ruby-on-rails - Rails 仅在管理命名空间中验证