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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:24:12+00:00 2026-05-29T09:24:12+00:00

I’m refactoring a WinForms (.NET 4) application that makes use of a TabControl to

  • 0

I’m refactoring a WinForms (.NET 4) application that makes use of a TabControl to contain a UserControl–the UserControl is instantiated in each TabPage with the end result being editors in each tab. These are editing a collection of items that ultimately feed into the object being edited by the form as a whole.

As an example class structure:

  • class School
    • string Name
    • string Address
    • Collection of Courses, each with several appropriate fields (Department, Name, etc.)

(It’s not actually a school-related application, but the metaphor works.)

Visually, the set of UserControls manages the Coursees, while the parent Form handles the School information.

Right now, I have a presenter for the Form/School, and a presenter for the UserControl/Course, with a view for each. The School’s presenter needs to control some information for the Courses, however. For instance, options selected for one Course restrict options in the others. The School model is handling the calculations of that, but it needs to get to the Course’s presenter.

I’m not having much success in finding examples of this type of relationship in MVP discussions, and this is my first time taking an MVP approach. What are good options for handling this? Is it appropriate for the School’s presenter to have a collection of the Course’s presenters to represent the set? Should the School’s view be holding a collection of the Courses’ views? (The final UserControls have to end up attached to the form somehow and somewhere, right?)

My main goals are (unsurprisingly) increasing testability and maintainability, and major sources in the process so far have been Michael Feathers’ “The Humble Dialog Box” and Jeremy Miller’s “Build You Own CAB” series.

  • 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-29T09:24:13+00:00Added an answer on May 29, 2026 at 9:24 am

    How I deal with similar situation is that parent presenter should know about child presenters (as constructor dependencies that is).

    Each child presenter has its view, so in the parent presenter my logic goes something like:

    Initialize()
    – initialize parent
    – call initialize on each child presenter (this is for fetching all necessary data EXCEPT the data that is primarily shown. For example, if you have a invoice presenter, you need to fetch customer collection from somewhere if you will have customer combobox so that you can change this for an invoice)
    – embed child views into parent view (parent is usually a form, where children are user controls)

    then after that, usually on loading the parent, with some LoadXXX method, I also load children. In your example, it would be something like

    schoolPresenter.LoadSchool(school)

    which would in turn load the data across all presenters, for example load parent controls with school details, pass the courses collection to the courses presenter etc…

    One think that I noticed it is good to do, is to have a Refresh() method on each of these presenters, which basically knows how to load itself based on current status. Maybe you cant have method like this on parent presenter, but simple presenters work fine like this, so that means that in LoadSchool method you can have something like

    coursesPresenter.Courses = school.Courses;
    coursesPresenter.Refresh();

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT

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.