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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:28:40+00:00 2026-05-14T02:28:40+00:00

I have been reading a lot on MVC/MVP patterns…. I have a simple question….If

  • 0

I have been reading a lot on MVC/MVP patterns…. I have a simple question….If you have a view with loads of controls….say 10 texboxes and 10 checkboxes….etc etc… Am I expected to specify the properties and events each one of them in my IView interface?….

  • 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-14T02:28:41+00:00Added an answer on May 14, 2026 at 2:28 am

    Definitely not that way.
    Your IView Interface will define set of contracts/ methods (it includes properties) that can be accessed by your business layer.
    It is totally wrong to exposed your control in interface like this:

    
    public interface IView
    {
      TextBox UserNameTextBox{get;set;}
    }
    
    

    You should not have interfaces defined in this way. This is really a bad programming.
    You should rather expose some contracts that your UI layer will implement.
    E.g.

    
    public interface IView
    {
     public void SetUserName(string Text);
    }
    
    

    You can implement this interface on winform as well as webform.

    Similarly, you are also not supposed to expose knowlede of UI in interface(Contract).
    Lets assume a scenario where you have to display information of Employee object on UI.
    You should pass Employee object to UI through this interface and UI will take care of way of representing this Employee object.
    Your BL should never bother about n number of TextBoxes and checkboxes.

    
    public class Employee
    { 
      //first name
      //last name
      //is manager
      //is teamleader
      //address
    }
    
    public interface IEmployeeView
    { 
      void SetEmployee(Employee employee);
    }
    
    
    public partial class EmployeeForm:WinForm,IEmployeeView
    {
      public void SetEmployee(Employee employee)
      {
        ENameTextBox.Text = employee.FirstName+" "+employee.LastName;
      } 
    
    }
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been reading a lot on design patterns lately and some of them
I have been reading a lot about how and why to use an MVC
I have been reading a lot about MVC these days and I think I
I have been reading a lot of Javascript lately and I have been noticing
I have been reading a lot about C++ casting and I am starting to
I have been reading a lot of django articles, including the official doc. Occasionally,
Lately I have been reading a lot of blog topics about big sites(facebook, twitter,
I have been noticing __construct a lot with classes. I did a little reading
I have been reading a lot about how flash development/design had died, and as
I have been reading a lot about HTML 5 and some of the changes

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.