gpt4 book ai didi

language-agnostic - 与 Ext 一起使用的表示模式

转载 作者:行者123 更新时间:2023-12-04 07:44:06 25 4
gpt4 key购买 nike

您认为哪种呈现模式Ext人情或你成功使用达到高可测试性 还有可维护性?

由于 Ext 组件实例通常与状态和某种表示逻辑(例如文本字段的格式验证)紧密耦合,被动 View 不是天生的。 主讲人 似乎它可以工作(我曾在一个场合轻松使用它)。 的适用性如何?演示模型 ?还有其他人吗?

虽然这个问题是专门针对 Ext 的,但它也适用于类似的框架,如 智能客户端 甚至 RIA技术,如 Flex .因此,如果您对任何其他 Web UI 技术有任何第一手模式经验,您的意见仍然会受到赞赏。

最佳答案

在考虑演示模式时,这是一个很好的引用:

Separating user interface code from everything else is a key principle in well-engineered software. But it’s not always easy to follow and it leads to more abstraction in an application that is hard to understand. Quite a lot design patterns try to target this scenario: MVC, MVP, Supervising Controller, Passive View, PresentationModel, Model-View-ViewModel, etc. The reason for this variety of patterns is that this problem domain is too big to be solved by one generic solution. However, each UI Framework has its own unique characteristics and so they work better with some patterns than with others.



就 Ext 而言,我认为最接近的模式是模型- View - View 模型,但是这种模式在保持关键原则(状态、 View 、模型)的分离的同时很难编码。

也就是说,根据上面的引述,每个模式都试图解决/划分/简化一个问题/情况,通常对于手头的单个应用程序来说太复杂了,或者当您尝试将其绝对化时通常会失败。因此,在模式匹配应用程序开发时考虑获得“最佳匹配”而不是绝对匹配。

并记住:

The reason for this variety of patterns is that this problem domain is too big to be solved by one generic solution.



我希望这有帮助!

关于language-agnostic - 与 Ext 一起使用的表示模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3560175/

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