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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:35:40+00:00 2026-05-15T07:35:40+00:00

This question is a bit rhetorical. At some point i got a feeling that

  • 0

This question is a bit rhetorical. At some point i got a feeling that ASP.NET MVC is not that authentic implementation of MVC pattern. Or i didn’t understood it.

Consider following domain: electric bulb, switch and motion detector. They are connected together and when you enter the room motion detector switches on the bulb. If i want to represent them as MVC:

  • switch is model, because it holds the state and contains logic
  • bulb is view, because it presents the state of model to human
  • motion detector is controller, because it converts user actions to generic model commands

Switch has one private field (On/Off) as a State and two methods (PressOn, PressOff). If you call PressOn when it is Off it goes to On, if you call it again state doesn’t change.

Bulb can be replaced with buzzer, motion detector with timer or button, but the model still represent the same logic. Eventually system will have same behavior.

This is how i understand classical MVC decomposition, please correct me if i am wrong.

Now let’s decompose it in ASP.Net MVC way.

  • Bulb is still a view
  • Controller will be switch + motion detector
  • Model is some object that will just pass state to bulb.

So the logic that defines behavior moves to controller.

Question 1: Is my understanding of MVC and ASP.NET MVC correct?
Question 2: If yes, do you agree that ASP.NET MVC is not 100% accurate implementation?

And back to life. The final question is how to separate model from controller in case of ASP.NET MVC. There can be two extremes. Controller does basic stuff and call model to do all the logic. Another is controller does all the logic and model is just something like class with properties that is mapped to DB.

Question 3: Where should i draw the line between this extremes? How to balance?

Thanks,
Andrey

  • 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-15T07:35:40+00:00Added an answer on May 15, 2026 at 7:35 am

    I think it could be either way. Here would be an implementation is ASP.NET MVC that keeps the logic like you had in your first example.

    Model (Respository)

    Function switchOn() as bulb
        if !bulb.lightOn then
            bulb.lightOn = true
        end if
            return bulb
    End Function
    
    Function switchOff() as bulb
        if bulb.lightOn then
            bulb.lightOn = false
        end if
            return bulb
    End Function
    
    Function Motion(senseMotion as boolean) as bulb
        if(senseMotion and !bulb.lightOn) then
             bulb.lightOn = true
        end if
        return bulb
    End Function
    

    Controller

    Function PressSwitchOn() as actionresult
         return view("Bulb", lightRepository.switchOn)
    End Function
    
    Function PressSwitchOff() as actionresult
         return view("Bulb", lightRepository.switchOff)
    End Function
    
    Function SomethingMoved(byval hasMoved as boolean) as actionresult
         return view("Bulb", lightRepository.Motion(hasMoved))
    End Function
    

    No business logic in my controller, it is simply passing the state from the model to the view. Am I in the ballpark of your example?

    To answer questions.

    1. Yes, I think you understand it pretty well
    2. No, I would disagree. One of the benefits of ASP.NET MVC is that it is extremely flexible in your implementation. You could put all of your logic in your view if you really wanted to (why, oh why would someone want to do that), but you have the option.
    3. I think to draw the lines, keep the DRY principles in mind. If you have logic repeated multiple times, make sure its part of the model or some custom business class that you can reference from one place. That to me is one of the main driving principles of designing a MVC app.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.