English 中文(简体)
• 介绍者与男性行为者之间如何沟通?
原标题:How do you communicate between presenter and view in MVP scheme?

我知道,基本上有两种选择。

第一种看法是暴露了应签字人的通知事件。 在用户点击某些纽顿时,认为只是引发一些事件,表明有些事情已经改变。

第二是使用观察员模式,让在场人干预一些合同。 让我们与我前面告诉你的事件等方法相衔接。 这一观点应附有一名发言者。

正如杰里米·米勒在其法定的Build Yous CAB series”blog post中指出,他最好使用第二种选择。

What s your opinion on this topic? How do you tie presenter and view in your projects? What s advantages or disadvantages for every options?

Let make some poll here. I think it would be useful. Thanks in advance!


www.un.org/spanish/ecosoc 为了回答Peter Ritchie的回答,。

我的问题是,我无所作为,我应该依靠一些人的意见作出决定,选择对我来说似乎是正确的办法。

接口的缺点是,你有具体的政变。 这一观点与一个接口相结合,必须实施这一接口。

但另一方面,事件不像某种合同一样(如接口那样)? 它把提出者与应该对这些事件作出反应的观点联系起来。

问题回答

观察员可以说谎。 如果你有几项控制,可以进行一些活动或几次活动,那么你就不得不在某个时候把这些事件连在一起。 如果你使用一个接口,它就在一个地方运行,如果你忘记执行一个接口的具体成员,就会发现一些类型的安全,并汇编错误。 接口的缺点是,你有具体的政变。 这一观点与一个接口并需要实施这一接口。 您可以使用接口隔离,以限制交汇到某个特定类别;但这增加了一定程度的复杂性。

没有人对此做出正确回答;你是否能够提供某种标准来帮助你作出决定?





相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签