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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:31:06+00:00 2026-05-28T05:31:06+00:00

Could anyone give an example of why it would be advantageous to use MVC

  • 0

Could anyone give an example of why it would be advantageous to use MVC instead of a simpler Model and a View only.

Note: whether it’s called MVC or MVP (Model-View-Presenter), I’m talking about the one where the View receives input, then the Controller will respond to the input event by interpreting the input into some action to be done by the Model. When the model changes, the View will update itself by responding to events from the model.

What is disadvantageous of simply letting the Model respond to events in the View and vice versa?

In MVC, if I changed the model in a way that affects the controller then I’ll have to do changes in the controller. In Model-View, if I change the Model, I’ll have to update the view.

So, it seems like we are introducing complexity by adding the “controller” part?

  • 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-28T05:31:06+00:00Added an answer on May 28, 2026 at 5:31 am

    In MVC, the Model is blind to its environment, the view can be too – passing off (blindly) its events to the controller, which knows more about the view and model. So when all is said and done, the controller is the ‘non-reusable’ disposable part of the system, since it is the most context aware component.

    if I changed the model in a way that affects the controller…

    The the model should expose simple CRUD methods in such a way that those using the methods do not have to know anything about the passed update object, nor what really happens inside the model.

    This means that the view, IMO, has to do a bit of work by creating the passed record, since Controllers are supposed to be stateless and the view is more persistent. Controllers get triggered and ‘kick-in’ do their work with a passed object and do not have a state.

    The passed data is created by some sort of generic convention.

    Let me go even further. Suppose you have a view, a tablegrid, and a control whose enabled property is dependent on item is selected in the grid — you COULD create a view that handles both those controls and this logic internally, and that would probably be the way to go in such a simplified example.

    But the more atomic your views are, the more reusable they become, so you create a view for every, yes every, control. Now you are looking at a situation where views have to know about each other in order to register themselves for the right notification…

    This is where the controller steps in, since we want to stick all these dependencies onto him, the long term disposable one. So the controller manages this type of view-to-view notification scheme.

    Now your views are ignorant as they can be and independent, thus reusable.

    You can code a view without having to know about the system, or the ‘business logic’ as they like to call it. You can code a model without having to know too much about your goals (though it does help to tweak the model to enable it to return the datasets you have in mind)…. but controllers, they are last and you have to have the previous two firmed up before you can wire things together.

    Here is another thing to think about — just as the Model is supposed to abstract-away and provide a generic interface to the underlying implementation of the data it is managing (the client does not know if the data comes from a DB, a file, a program setting, etc) — the view should also abstract away the control it is using.

    So, ultimately this means a view should not (caveat below) have functions/properties that look like this:

    public property BackgroundColor{get;set}
    

    Nor

    public function ScrollBy(x,y){}
    

    But instead:

    public SetProp(string name, object val){}
    

    And

    public DoCmd(string name, object val){}
    

    This is a bit contrived, and remember I said ultimately… and you ask why is this a good idea?

    With reusability in mind, consider that you may one day want to port things from WinForms to, say, Flex, or simple want to use a new-fangled control library that may not expose the same abilities.

    I say ‘port’ here, but that is really not the goal, we are not concerned with porting THIS particular app, but having the underlying MVC elements generic enough to be carried across to a new flavor — internally, leaving a consistent and ability-independent external interface intact.

    If you didn’t do this, then when your new flavor comes along, all your hard references to view properties in the (potentially reusable/refactorable/extendable) controllers have to be mucked with.

    This is not to mean that such generic setters and cmds have to be the interface for all your views abilities, but rather they should handle ‘edge case’ properties as well as the normal props/cmds you can expose in the traditional hard-link way. Think of it as an ‘extended properties’ handler.

    That way, (contrived again), suppose you are building on a framework where your buttons no longer have buttonIcon property. Thats cool because you had the foresight to create a button view interface where buttonIcon is an extended property, and inside the view your conditional code does a no-op now when it receives the set/get.

    In summary, I am trying to say that the coding goals of MVC should be to give the Model and View generic interfaces to their underlying components, so when you are coding a Controller you don’t have to think to hard about who you are controlling. And while the Controllers are being (seemingly unfairly) set up to be the sacrificial lamb in the long run of re-usability — this does not mean ALL your controllers are destined for death.

    They are hopefully small, since a lot of their ‘thinking’ has been shoved off into semi-intelligent Models and Views and other controllers (ex: Controller to Sort a Grid or Manipulate a TreeView) — so being small they can be easily looked at and qualified for reuse in your next project — or cloned and tweaked to become suitable.

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

Sidebar

Related Questions

Could anyone give me example code to access the command line through VBScript? I
Could anyone give an example program that explains Java Threads in a simple way?
Could anyone give me an example about how to do fuzzy matching of two
I was wondering if anyone could give me an example or point me to
Could anyone give me a small and simple example of how to do this?
Could anyone give me an example or a good place to start looking on
could anyone give me a good example of using rhino mocks, nunit, and unity
Hi I wonder if anyone could give me an example how the TickGetDiv256(); function
Dear Stackoverflow user, Could anyone give me an simple example of restful webservice with
Could anyone give me some help with this please? The content needs to appear

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.