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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:49:27+00:00 2026-05-11T21:49:27+00:00

I have written a MVP project where the View is a WinForm that implements

  • 0

I have written a MVP project where the View is a WinForm that implements my IView interface.
I am in the process of reviewing the code, improving it where I can and would like to ask your thoughts regarding how the view and presenter interact. Which of the following is best practice in your opinion?

  1. Expose methods of the presenter class for the view to use. (i.e make them public).
  2. Have the presenter listen to events raised by the View class.

For example, my MVP uses a service that communicates via a serialport. To connect to the remote device my view calls the public Presenter method Connect() which then calls the appropriate service methods.

Would it be better practice to raise a Connect() event and have the presenter listen for it?

  • 1 1 Answer
  • 1 View
  • 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-11T21:49:27+00:00Added an answer on May 11, 2026 at 9:49 pm

    Generally I work so that the view is dependant on the presenter and the presenter is dependant on the model. This means the same model can be used by multiple presenters and the same presenter can be used my multiple views (different UI layouts, or Winforms vs Web etc). To facilitate this the view calls public methods on the presenter and listens to events from the presenter to say when data has changed.

    For an example of why you may want to work this way imagine an interface that has two views one for a beginner user and one for an expert, with the beginner view showing a subset of the expert commands. If the same presenter is used for both of these views then the beginner view will need to expose events for all the expert commands since the presenter needs them to be there so it can bind to them – even though they will never be triggered. On the other hand the presenter can expose methods for all of the expert options and the beginner view just never calls them, this means that neither the view nor the presenter are implementing unused functionality.

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

Sidebar

Related Questions

I have written down a code that should do garbage collection for c programs.
I have a small application that I have written that uses the MVP pattern
I have written this code inside a servlet to delete certain records from three
I have written this code in JavaScript and works perfectly fine when I include
I have written a function that sorts a big scale of data. To test
I have written a function that extract the domain from hostname. e.g. www.domain.com ->
I have written a very simple CTE expression that retrieves a list of all
Have written the following code: m_selectCategoryTableWidget = new QTableWidget; m_selectCategoryTableWidget->setRowCount(0); m_selectCategoryTableWidget->setColumnCount(2); m_selectCategoryTableWidget->setHorizontalHeaderLabels(QStringList()<<tr(Category)<<tr(Number of items));
I have written a sample code to practise Spring Bean Injection using setter methods.
I have written a pretty-printer using the GDB Python interface for a (C) struct

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.