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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:05:55+00:00 2026-05-23T12:05:55+00:00

I am struggling on how to implement the model-view-presenter pattern. The way I use

  • 0

I am struggling on how to implement the model-view-presenter pattern. The way I use this pattern is as follows:

  • I create a view (= interface) for a form
  • I create a presenter for the form that accepts the view as a parameter in the constructor
  • The form implements the view and creates a presenter object.

Now I have a form where a company can be registered. But the can have multiple contact persons. So, on this form I have a grid with contact persons.

My question is, should I add the contact person fields to the same view as the other company fields? Or should I seperate it in another view, so that the form implements two views (the ICompanyView and IContactPersonView) with two presenter classes?

  • 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-23T12:05:56+00:00Added an answer on May 23, 2026 at 12:05 pm

    First of all, don’t have your views instantiate presenters, you don’t want that. Whatever the flavor you use for MVP (Passive View, Supervising Controller) your view should contain as less as possible. What I do is have a view in presenter constructor, and in presenter Initialize() method I assign view.Presenter = this (you can also do this in Start() or some other “show” method, but I usually separate Initialization to another call because of the presenter lifecycle issues)

    As for your multiple views question, if you have complex logic in that part of the form (but I don’t see it in your example) you could probably separate that in separate user control / MVP triad – this helped me to reduce and simplify the code of the presenters.

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

Sidebar

Related Questions

I've been struggling to create a form for a Mongoid model that has an
In [ this post ], I'm struggling to implement a State Pattern as @jonp
There is unfortunately no TabControl.SelectionChanging event (Selector.SelectionChanging), I am struggling to implement this behavior
I have a requirement that I'm struggling to implement. If possible, I'd like to
I'm struggling to find the best way to implement my update to the database
I'm struggling to use Twitter's Finagle library to implement an HTTP request to a
I'm struggling with some Generic constraint issues when trying to implement a library that
I'm struggling to implement ACL in CakePHP. After reading the documentation in the cake
I am struggling alot with some PHP I am needing to implement a next
Been struggling with this simple selector problem a couple of hours now and must

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.