gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 16:26:44 24 4
gpt4 key购买 nike

我设计了一个 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com