views:

6541

answers:

6

Does anyone have a good example code or test project for explaining someone MVP pattern. There are a lot of explanation links but i want to have some good example code to show others without reinventing the wheel.

A: 

http://www.codeplex.com/smartclient

:)

nlaq
+7  A: 

Jeremy Miller's "Build your own CAB" series is fantastic. You get a nice dose of MVP (along with some other smart client patterns such as Pub/Sub).

http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx

Ben Scheirman
A: 

I don't see a link to the actual source code used in the screencast, but you could have them watch Jean Paul Boodhoo's dnrTV MVP screencast. The video is more useful than just reading code without an understanding of the underlying context in my opinion.

Edit: Didn't notice the WinForms in the question title at first. The screencast is ASP.Net WebForms, but it should be apparent how to apply MVP in WinForms as well.

Ben Robbins
A: 

You may want to try the Claymore Framework.

sardokan
A: 

I've used with success the following open source project to implement the MVP pattern in ASP.NET + WinForms + C#:

  • Castle Project.

Take a look at my blog post which shows a complete ASP.NET Web Application sample:

Model View Presenter pattern with Castle in ASP.NET

Leniel Macaferi