DCI - 数据,上下文和交互 - MVC的后继者? [英] DCI - Data, Context and Interaction - Successor to MVC?

查看:135
本文介绍了DCI - 数据,上下文和交互 - MVC的后继者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据,上下文和互动(DCI)将它推荐给组织?

它由 Trygve Reenskaug MVC模式的创建者。

它真的是MVC的继承者还是其他模式?它的利弊是什么?

Is it really the successor to MVC or just another pattern? And what are its pros and cons?

推荐答案

我得到的印象是,这不是一个继承人到MVC,如补充,例如图5中的 artima文章在DCI 上都有。我认为这应该有助于使模型和控制器之间的区别更加理智,或者可能在控制器的不同部分或模型的不同部分之间。

The impression I got is that it's not a successor to MVC so much as a complement, for example figure 5 in the artima article on DCI has both. I think it's supposed to help make the distinction between model and controller more sane, or maybe between different part of the controller or different parts of the model.

要将特定动作的逻辑分解为数据类,并将其移动到traits / mixins / any,一个(用户)操作。你会有很多小的代码,而不是几个大块。此外,似乎添加新的mixins应该比向基类添加功能更好。单独行动的代码可能(我想?)更加分散,但是不同行为的代码应该更加清晰明了。

The basic idea seems to be to split logic for particular actions our of your data classes and move it to traits/mixins/whatever, one per (user) action. You'll have many small pieces of code, instead of a few large pieces. Also, it sounds like adding new mixins is supposed to be "better" than adding functionality to your base classes. The code for individual actions will probably (I think?) be more spread out, but code for different actions should be more clearly and obviously separated.

这篇关于DCI - 数据,上下文和交互 - MVC的后继者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆