我设计了一个 MVC(在 .NET 中),其中 View 没有到模型的链接。它只知道 Controller 。传统的 MVC 模式的所有部分都相互通信。就我而言, Controller 基本上是一个中介。这将任何异常或逻辑排除在 View 之外。它对模型的依赖为零。这不再是MVC了吗?
最佳答案
您所描述的实际上是名为 Passive View 的模型- View - Controller 的子集.
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 Fowler在 above link 中谈到它并简要讨论其他变化 here .
关于.net - 当 View 不与模型交互时,它是 MVC 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/493867/