presentation型号VS被动视图 [英] Presentation Model vs Passive View

查看:258
本文介绍了presentation型号VS被动视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道关于上面提到的两个模式之间的区别。当你考虑,你需要在presentation模型模式同步code和code在presentation模型本身,那么我认为模式是非常相似的。

i am wondering about the difference between the two mentioned patterns. when you consider, that you need synchronization code in the presentation model pattern and that code is in the presentation model itself, then i think the patterns are quite similar.

这两个事件委托给presentation模型/ presenter。 presentation模型和presenter指挥域模型,并且还观察域模型。上发生的变化,他们都同步的观点(因为在presentation模型同步code是在presentation模型)。

Both delegate events to the presentation model / presenter. presentation model and presenter command the domain model and do also observe the domain model. on occuring changes, they both sync with the view (since the synchronisation code in the presentation model is in the presentation model).

在我看来,不同的是,presentation模型是视图的抽象形式。它描述视图的状态和行为。因此它具有所有视图状态信息的属性。而这个信息是通过同步code同步。
在被动看来,presenter不nessessarily视为视图的抽象形式。所以presenter不nessessarily具有属性重新presenting视图状态。所以presenter不同步的状态(在控制perperties和presenter本身)。相反,他简单的拷贝(上进行更改)域数据的控制。
这样的差别在本质上是视图的抽象,即presentation模型提供,而在被动视图中的presenter coud被视为域数据的数据映射。

in my opinion the difference is, that presentation model is an abstract form of the view. it describes the state and behavior of the view. so it has properties for all view state information. and this information is synched via sync code. in passive view, the presenter is not nessessarily seen as an abstract form of the view. so the presenter does not nessessarily have properties representing the view state. so the presenter does not "sync" the states (perperties on controls and the presenter itself). instead he simply "copies" (on changes) domain data to the controls. so the difference is in essence the abstraction of the view, that presentation model provides while in passive view the presenter coud be seen as a data mapper for domain data.

是OK,到目前为止还是我错过了什么重要的?

is that ok so far or do i miss something important?

感谢和问候
帕特里克

thanks and best regards patrick

推荐答案

我的理解是被动视图是MVP和presentation模式的变体是一个独立的模式。

My understanding is that Passive View is a variant of of MVP and Presentation Model is a separate pattern.

当你已经强调presentation模式有看法的抽象重新presentation,后来被称为一个ViewModel在MVVM。 MVP有鉴于无重状态presentation中,presenter调用相应的视图。被动视图意味着视图电话一般都是不可知的任何领域的概念,因此在很大程度上原始类型。而监督控制器变量允许对视图传递领域概念,它可以跨preT。

As you've highlighted Presentation Model has an abstract representation of the view, later called a ViewModel in MVVM. MVP has no stateful representation of the view, the presenter calls the view accordingly. Passive View means that the view calls are generally agnostic of any domain concepts, so largely primitive types. Whereas the Supervising Controller variant allows the view to be passed domain concepts that it can interpret.

我已经说过了,这仅仅是我的理解。我很高兴能得到纠正。

As I've said, this is just my understanding. I'm happy to be corrected.

这篇关于presentation型号VS被动视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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