What is common practice, one presenter for View view and one for Edit view, or should it be all in one presenter.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With