演示模式用于Ext [英] Presentation patterns to use with Ext

查看:108
本文介绍了演示模式用于Ext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您认为哪种演示文稿模式 Ext 有助于您成功使用实现高可测性和可维护性



由于Ext组件实例通常与状态和某种表示逻辑紧密耦合(例如,格式验证文本字段),被动视图不是一个天然的合适。 监督演示者似乎可以正常工作(而且我已经无痛地使用它了)。演示模式的适用性如何?任何其他人?



虽然此问题专门针对Ext,但它可以应用于类似的框架,如 SmartClient 甚至 RIA 技术,如 Flex的。所以,如果您有任何其他网络UI技术的第一手图案体验,您的输入将仍然不胜感激。

解决方案

当考虑演示模式时,这是一个很好的报价:


将用户界面代码与
分开一切都是关键原则
精心设计的软件。但是它不是
总是很容易遵循,它导致
更多的抽象在应用程序
,这是很难理解。相当一个
很多设计模式尝试定位这个
的场景:MVC,MVP,监督
控制器,被动视图,
PresentationModel,
Model-View-ViewModel等
对于这种模式的原因是
这个问题域太大,不能被一个通用解决方案解决。
然而,每个UI框架都有自己的
独特的特征,所以他们的
的工作效率比
与其他模式更好。


就Ext而言,在我看来,最接近的模式将是Model-View-Viewmodel,但是这种模式本身难以编码,同时保持关键原则的分离(状态,视图,模型)。



这就是说,根据上面的引用,每个模式试图解决/分区/简化问题/情况往往太复杂手头的个人应用,或者当您尝试将其置于绝对状态时经常失败。因此,考虑在模式匹配应用程序开发时,要获得最适合而不是绝对的。



并记住:


这种各种模式的原因

这个问题域太大,无法通过一个通用解决方案解决
。 >

我希望这有帮助!


Which presentation patterns do you think Ext favors or have you successfully used to achieve high testability and also maintainability?

Since Ext component instances usually come tightly coupled with state and some sort of presentation logic (e.g. format validation for text fields), Passive View is not a natural fit. Supervising Presenter seems like it can work (and I've painlessly used it in one occasion). How about the suitability of Presentation Model? Any others?

While this question is specifically for Ext, it can apply to similar frameworks like SmartClient and even RIA technologies like Flex. So, if you have any first-hand pattern experiences with any other web UI technologies, your input would still be appreciated.

解决方案

When thinking of presentation patterns, this is a great quote:

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.

As far as Ext is concerned, in my opinion the closest pattern would be the Model-View-Viewmodel, however this pattern is inherently difficult to code for whilst maintaining the separation of the key tenets (state, view, model).

That said, as per the quote above, each pattern tries to solve/compartmentalise/simplify a problem/situation often too complex for the individual application at hand, or which often fails when you try and take it to its absolute. As such, think about getting a 'best fit' as opposed to an absolute when pattern matching application development.

And remember:

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

I hope this helps!

这篇关于演示模式用于Ext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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