views:

280

answers:

3

What is common practice, one presenter for View view and one for Edit view, or should it be all in one presenter.

+3  A: 

The rule of thumb which I follow is... - 1 Presenter 1 View

But for common controls you could share the presenter if the presentation logic is same... For eg... You have a Dialog control for "Confirmation dialog", "Operation Complete dialog!", and many other variants... For this I had this control realize from a common view interface and had one presenter serving the whole suite of dialog controls...

The reason is it helps to keep the pattern clean. Also, in terms of flexibility this has its own benefit..

Recently I had a task to migrate a windows application built on MVP to asp.net (1 view 1 presenter rule of thumb). The migration was seamless as I only had to worry about creating respective views rest of the things were taken care of by the design.

rajesh pillai
+2  A: 

I asked a similar question about WinForms, but I think the answer covers any form of MVP. The general consensus was that you should use 1 Presenter for each view.

SwDevMan81
A: 

what about a winform that has a tabcontrol in it? does each page in the tab control have it's own presenter and does the winform inherit each of those interfaces?

turin