MVP Framework

Lately between baby feedings, baby burpings, baby sittings, baby sleepings, baby poopings, baby peeings, baby playing, and baby photo shoots I've been working an an MVP Framework for ASP.Net 2.0.  My Framework is more along the lines of Martin Fowler's Supervising Presenter.

I am putting together something I think will be very useful for quickly creating highly dynamic and configurable web applications.  The framework relies on the Windsor Container from the Castle Project.  The Web framework does all the MVP plumbing for you.  All you need to do is create a small Web Project with a single Page to act as the generic host for UserControls/Server Controls.  Then you create your Models, Presenters, and Views and the framework will hook everything together using Dependency Injection.  

So far it has been a lot of fun and I have been digging deeply into the Castle MicroKernel and the Windsor container.  Specifically creating some custom contributors to allow UserControls to be added, configured, and resolved by the Container.  So far the Framework is 36 KB and it's toight like toiger.

I borrowed heavily from MonoRail, also part of the Castle project.  I love the concept of MonoRail but I think it is too big of a jump for most ASP.Net developers.  I'm hoping my MVP Framework can be a happy medium between the two-tier DataSet ASP.Net approach and the full on MVC approach in MonoRail.

The "Views" are simply pre-compiled UserControls or custom Server controls.  The Presenters encapsulate all the business logic and Service interaction.  You can see the simple Interfaces for these two portions of the Framework below.  I want to do some finishing touches and put together an example before I release anything, but I will keep you all posted.  I'll be posting regularly in the next few days explaining why MVP and why my Framework is beneficial.

using System;
 
namespace WCPierce.MVP.Framework
{
  public interface IPresenter
  {
    IView View { get; }
 
    void Initialize(bool isFirstCall);
  }
}
using System;
 
namespace WCPierce.MVP.Framework
{
  public interface IView
  {
    void SetPresenter(IPresenter presenter);
 
    void Initialize(bool isFirstCall);
  }
}

posted @ Friday, August 18, 2006 9:47 AM


Print

Comments on this entry:

# re: MVP Framework

Left by Surjo at 3/16/2007 11:12 AM

would you please give more information about using MVP Framework.

# re: MVP Framework

Left by Bill Pierce at 3/16/2007 11:36 AM

Surjo,
You can read my follow up posts:

http://blogs.meetandplay.com/WPierce/archive/2006/08/19/MVP_Continued.aspx

http://blogs.meetandplay.com/WPierce/archive/2006/09/04/MVP__Tying_it_all_Together.aspx

http://blogs.meetandplay.com/WPierce/archive/2006/12/24/Revisited_MVP_Framework.aspx

# re: MVP Framework

Left by Oleg Zhukov at 11/2/2008 5:43 AM

Hey, you might be interested in another MVP Framework implementation - MVC# ( http://www.mvcsharp.org ).

Thanks,
--
Oleg Zhukov

Your comment:



 (will not be displayed)


 
 
 
Please add 4 and 7 and type the answer here:
 

Live Comment Preview:

 
«July»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678