Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 209867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:57:15+00:00 2026-05-11T17:57:15+00:00

We are trying to get the Model-View-Presenter pattern used on (virtually) all new dev

  • 0

We are trying to get the Model-View-Presenter pattern used on (virtually) all new dev work that we undertake.

I’m a strong believer in having a framework to help people meet a design requirement, we have a few in-house frameworks for various different components (logging, email sending, etc), so I’m trying to get some kind of MVP framework developed.

I’ve managed to put together something that is easy to use for people who aren’t familiar with MVP and that isn’t too far removed from how we currently work. The problem is that it’s doing a relationship of 1 view to 1 presenter.

Here’s a rough outline of the framework:

public abstract class Presenter<TView> where TView : IView {
  public virtual T View { get; set; }

  public virtual void Setup(TView view) {
    this.View = view; 
  }
}

public interface IView { }

The basic way that it works is that any View created inherits from the IView interface, and passed to a Presenter class which inherits from the Presenter abstract class.

As you can see I’m using .NET generics so that the developer will have strong typing of the View when they are working on the presenter (and then ultimately a class inheriting from the presenter).

So I can set up a basic login component like this:

public class Login : Presenter<ILogin> {
  public override Setup(ILogin view){
    base.Setup(view);
    this.View.Login += new EventHandler(login);
  }
  void login(object sender, EventArgs e) { ... }
}

public interface ILogin : IView {
  string Username { get; set; }
  string Password { get; set; }
  event EventHandler Login;
}

So as I said I quite like this, there’s compiler enforced typing, strongly typed views and a MVP-like pattern.

Some people though are not quite as happy with the implementation, because it has a 1 to 1 relationship between presenters and views, and strictly speaking this isn’t how MVP is meant to be.

I question how valid this argument really is, on the several projects I have been trailing this framework with (ranging from medium to large projects) I haven’t found any good example where I thought “I need to have multiple views for this presenter”. When I see functionality which can be shared across multiple views I question if it should even be tied to a particular presenter, or whether it should be in a more neutral class.

Is the framework I’m trying to achieve too far from MVP to be called MVP? Is the need to have mutliple views to a presenter the primary goal of MVP? Is it even possible to have a true .NET MVP framework with n-view support?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:57:15+00:00Added an answer on May 11, 2026 at 5:57 pm

    I don’t see a problem with your approach. You don’t strictly need to have a one-to-many relationships between a presenter and views – usually you only have one view per presenter. The idea behind MVP is decoupling presenters from views, so that you can switch the view more easily if you need to (for example, supporting both Web application and a desktop application), but that doesn’t mean you have to make it dynamic.

    One suggestion: I usually supply the IView as a constructor parameter to the Presenter. The concrete implementation of IView then creates the presenter (either by hard-coded new Presenter (this) or using an IoC container to get it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 216k
  • Answers 216k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer for type_key, type in TYPES.iteritems(): for sub_type_key, sub_type in type.iteritems():… May 12, 2026 at 11:15 pm
  • Editorial Team
    Editorial Team added an answer I look at vertical space in code the way I… May 12, 2026 at 11:15 pm
  • Editorial Team
    Editorial Team added an answer Okay guys, I solved it. I needed to change three… May 12, 2026 at 11:15 pm

Related Questions

I'm trying to get WPF validation to work within the MVVM pattern. In my
I'm new to nHibernate, and trying to get my head around the proper way
I'm developing an application in Silverlight2 and trying to follow the Model-View-ViewModel pattern. I
One-line summary: What is the best practice for unhooking event handlers created in the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.