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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:50:29+00:00 2026-05-11T22:50:29+00:00

My first try of MVC. Am trying to implement a simple example. Inspiration from

  • 0

My first try of MVC. Am trying to implement a simple example. Inspiration from here. Have I got this pattern (yet!)?

  1. View: “Hey, controller, the user just told me he wants the first person”

  2. Controller: “Hmm, having checked his credentials, he is allowed to do that… Hey, model, I want you to get me the first person”

  3. Model: “First person… got it. Back to you, Controller.”

  4. Controller: “Here, I’ll collect the new set of data. Back to you, view.”

  5. View: “Cool, I’ll show the first person to the user now.”

View:

namespace WinFormMVC
{
    public partial class Form1 : Form
    {
        controller cont = new controller();

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Text = cont.checkPermissionsAndGetFirstPerson();
        }
    }
}

Controller:

public class controller
    {
        public string checkPermissionsAndGetFirstPerson()
        {
            string returnValue = "";
            if (checkPermissions())
            {
                model m = new model();
                returnValue =  m.getFirstPerson();
            }

            return returnValue;

        }

        public bool checkPermissions()
        {
            return true;
        }
    }

Model:

public class model
    {
        public string getFirstPerson()
        {
            return "Bill Smith";
        }
    }
  • 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-11T22:50:30+00:00Added an answer on May 11, 2026 at 10:50 pm

    Hmm… I am not sure if I’d call this MVC… As with ASP.NET WebForm, this form is more like an MVP pattern.

    As per my understanding, in MVC, controller is the one responsible for managing all resources and flow of the code. In your example, you basically creating a Windows Form first (the view) and then attach a controller to it which is more of a MVP sort of things.

    In a classical MVC pattern, the Model, once instantiated, will be linked to the View and when the model changes, the view will get notified (possibly through Observer / PubSub pattern).

    Button click, etc. from the View will be routed to the controller which will coordinate those sort of stuffs.

    see: this.

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

Sidebar

Related Questions

I'm trying to build my first app on CodeIgniter. This is also my first
I'm trying to build my first app on CodeIgniter. This is also my first
I have a wizard in my asp.net MVC application which is built upon this
I'm hosting an ASP.Net MVC site in the root directory, and when I try
I am in the process of creating my first site in ASP.NET MVC, it
I have an asp.net MVC application that has one section /admin locked down via
I am taking over quite a big ASP.NET MVC project, and I am just
I have a table with records that has delete links. Basically I followed the
I've started working on my master's project and decided to try something new and
I decided to use JSR303 to validate my forms in Spring 3.0 MVC application.

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.