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 9252521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:57:55+00:00 2026-06-18T10:57:55+00:00

Intro: I am using the MVP as a design pattern for a windows form

  • 0

Intro:
I am using the MVP as a design pattern for a windows form application with some basic CRUD operations.

Requirement
I want to implement an IView interface as an abstract class since it will be used by multiple views, and i can provide some common concrete implementations (like showing dialog boxes with error messages).
Now my IView was implemented in the same project as the Presenter.
Because of this i cannot add any Windows.Forms references out in this project as it violates the MVP pattern.

Proposed Solution:
My solution was to move the IView to a different and new project. Add my win forms references here. This will allow me accomplish the above.

Problem
I am just not sure if this is good design. Am i violating any rules here?

  • 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-06-18T10:57:57+00:00Added an answer on June 18, 2026 at 10:57 am

    You could declare the view interface in the Presenter project and the abstract base view class in the Views project, like so :

    (Presenter project)

    public interface IView 
    {
      void ShowErrorMessage(string message);
    }
    
    public interface IFooView : IView
    {
      string SomeField { get; set; }
      //...
      event EventHandler SomethingClicked;
      //...
    }
    
    public class FooPresenter 
    {
      private readonly IFooView _view;
    
      public FooPresenter(IFooView view)
      {
        // inject view here
      }
    
      public void DoSomething()
      {
        // error case
        _view.ShowErrorMessage("some message");
      }
    }
    

    (View project)

    public abstract class BaseView : IView
    {
      protected void ShowErrorMessage(string message)
      {
        // implement shared behavior here
      }
    }
    
    public class FooView : BaseView, IFooView
    {
      // view specific behavior here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MVP pattern to develop a large scale application. While working in the
I'm trying to implement an MVP pattern using STL and I have used *shared_ptr*
I'm working on an ASP.NET webapp using the MVP pattern, and as I'm organizing
So some background, I am working in GWT, using MVP and activities and places.
This is for a client-side MVP program, using Passive View. I want to allow
INTRO: I created a java application using JFrame. I have a JMenuBar at the
I have a GWT MVP application using Activities and Places. This is inspired by
Intro: The basic Fragments Tutorial pattern goes something like this: On a tablet, have
If I am using the MVP pattern with GWT, as in the GWT architecture
I'm currently implementing a project using asp.net, c# and the MVP (Model-View-Presenter) pattern. The

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.