【发布时间】:2020-01-14 15:56:26
【问题描述】:
关注this articleThere are two schools of thought with regard to whether the View interacts directly with the Model or not.
我对 View 不与 Model 交互的情况感兴趣。如果只有 Controller 知道 View 而 View 不知道 Controller,我们可以通过调用 Controller 中的 View 和 Model 方法轻松地使用 Model 数据更新 View(例如写一些文本)。
但是,如果 View 不知道 Controller 或 Model,Controller 和 Model 如何对 View 更改(例如按钮按下)做出反应?
【问题讨论】:
标签: model-view-controller design-patterns