MVP pattern

Hi all,

I'm using the MVP pattern in my application . I did many views and their presenters .

During the views building' I noticed that many fanctionalities are the same and common between the presenter.

It's right that this pattern did the separaton between the UI and mu BL but I still think how to smarter code for resusing the code.

I mean :

1. How I can make common code between the presenters ?

2. If I want to use the view in another palce, how can use it with it's presenter.

3. Is there any recommended patterns used with this pattern ?

4. Any links for tutorials ?

Thanks in advance...

[671 byte] By [wasimf] at [2008-1-6]
# 1
I assume you googled for the specific MVP pattern and found one or two tutorials.

Recommendations for a clean implementation of this pattern can be found in the web client software factory. This blogpost by David Hayden is a great starting point to learn more.

PaulGielens at 2007-10-2 > top of Msdn Tech,Architecture,Modeling and Tools...
# 2

http://www.polymorphicpodcast.com has several podcast devoted to this subject. I found them extremely helpful, hopefully you can also.

maybede at 2007-10-2 > top of Msdn Tech,Architecture,Modeling and Tools...
# 3

The Smart Client Software Factory uses it as well. Presenters there are implemented as classes derived from a generic (as in Presenter<T>) presenter class. This way, a lot of common code is moved to the base class. The SCSF also uses other patterns, like the command pattern, Publisher-Subscriber and others to provide a common implementation for code that would otherwise end up in the presenter.

You should experiment with the factory that matches you project (Winforms or Web) and see how things are implemented there.

PanagiotisKanavos at 2007-10-2 > top of Msdn Tech,Architecture,Modeling and Tools...
# 4

I have to mention the following posts from Jeremy Miller:

http://codebetter.com/blogs/jeremy.miller/archive/tags/Build+your+own+CAB/default.aspx

EvanH at 2007-10-2 > top of Msdn Tech,Architecture,Modeling and Tools...
# 5

Wasim,

MartinPlatt at 2007-10-2 > top of Msdn Tech,Architecture,Modeling and Tools...
# 6

Wasim,

Ron Jacobs did a couple of casts on MVP at ARCast (and the different sorts of patterns within that space, as defined by Martin Fowler), Polymorphicpodcasts.com also have done some that I have listened to, and should address the issues that you are facing.

I'd have thought that googling this subject would give you a fairly large list of resources to read, as it's a fairly common pattern to use.

Cheers,

Martin.

MartinPlatt at 2007-10-2 > top of Msdn Tech,Architecture,Modeling and Tools...