.net - 当 View 不与模型交互时,它是 MVC 吗?

标签 .net model-view-controller design-patterns

我设计了一个 MVC(在 .NET 中),其中 View 没有到模型的链接。它只知道 Controller 。传统的 MVC 模式的所有部分都相互通信。就我而言, Controller 基本上是一个中介。这将任何异常或逻辑排除在 View 之外。它对模型的依赖为零。这不再是MVC了吗?

最佳答案

您所描述的实际上是名为 Passive View 的模型- View - Controller 的子集.

alt text

Passive View is yet another variation on model-view-controller and model-view-presenter. As with these the UI is split between a view that handles display and a controller that responds to user gestures. The significant change with Passive View is that the view is made completely passive and is no longer responsible for updating itself from the model. As a result all of the view logic is in the controller. As a result, there is no dependencies in either direction between the view and the model.



Martin Fowlerabove link 中谈到它并简要讨论其他变化 here .

关于.net - 当 View 不与模型交互时,它是 MVC 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/493867/

相关文章:

c# - 如何在 C# 中触摸文件?

c# - 将 wif 与 web api 一起使用

ruby-on-rails - 如何在 MVC 中表示跨模型信息?

php - JavaScript 与 Php MVC

java - 工厂模式: Supporting new concrete types

c# - 领域驱动设计适合我的项目吗?

.net - 关于 ASP.NET 缓存,滑动过期的目的或原因是什么?

c# - .NET 中角色的权限

java - 如何避免静态资源请求被路由到拦截器?

php - 创建一个像 facebook 和 gmail 这样的线程私有(private)消息系统