Questions tagged [model-view-controller]

Model–View–Controller (MVC) is an architectural pattern, introduced in mid 1970-s in PARC into how to compose software interfacing also with user-interactions. For Microsoft ASP.NET MVC, please use [asp.net-mvc] or [asp.net-core-mvc] tag instead. For Spring MVC, please use [spring-mvc] tag instead.

Model–View–Controller (MVC) is an architectural pattern used in software engineering, since Palo Alto Research Centre released one such in mid 1970-ies, designed in Smalltalk-79 language.

The pattern isolates "domain logic" (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing, portability and maintenance of each (separation of concerns).

Image which demonstrates typical collaboration of the MVC components:

MVC

Reference

The analogy

MVC can be metaphorically related to a TV. You have various channels, with different information on them supplied by your cable provider (the model). The TV screen displays these channels to you (the view). You pressing the buttons on the remote controls affects what you see and how you see it (the controller).

33635 questions
70
votes
2 answers

MVC for advanced PHP developers

I need some help from more experienced programmers. I want to improve my MVC skills. But I could not find a good tutorial on Google for MVC. Google always gives "MVC for beginners". I understand what MVC is and I can make it, but I'm not experienced…
Ivan
  • 5,139
  • 11
  • 53
  • 86
69
votes
11 answers

MVC vs. 3-tier architecture?

What is the basic difference between MVC and 3-tier architecture?
chhaya
  • 719
  • 1
  • 6
  • 7
69
votes
5 answers

DDD and MVC: Difference between 'Model' and 'Entity'

I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that exist today put the Model between the Controller and the database, and the Model almost acts like a database abstraction layer. The concept of 'Fat Model Skinny…
Nathan Loding
  • 3,185
  • 2
  • 37
  • 43
69
votes
6 answers

How would you implement MVC in a Windows Forms application?

I don't develop too many desktop / Windows Forms applications, but it had occurred to me that there may be some benefit to using the MVC (Model View Controller) pattern for Windows Forms .NET development. Has anyone implemented MVC in Windows Forms?…
Chris Pietschmann
  • 29,502
  • 35
  • 121
  • 166
69
votes
8 answers

what is the difference between 3 tier architecture and a mvc?

what is the difference between 3 tier architecture and a mvc ? Are they same? Both have 3 layers i.e model, views and controller
user1414880
64
votes
3 answers

How to read appsettings.json in my _layout.chtml

I cannot seem to figure out how to read values from the appsettings.json in my _Layout.chtml file. Is it not just available, something like this? @Configuration["ApplicationInsights:InstrumentationKey"] I created a new MVC project using razor…
64
votes
6 answers

What are the differences between Presenter, Presentation Model, ViewModel and Controller?

I have a pretty good idea how each of these patterns work and know about some of the minor differences between them, but are they really all that different from each other? It seems to me that the Presenter, Presentation Model, ViewModel and…
64
votes
4 answers

What is Model View Presenter?

Can someone please explain in a way as simple as possible what the Model View Presenter pattern is? What is the difference with Model View Controller ? Which is best or for which purpose ?
bluediapente
  • 3,946
  • 5
  • 32
  • 38
63
votes
1 answer

Difference between Request MVC and Component MVC

I have heard that JSF is implementing the component based MVC and Spring MVC is implementing the request based MVC. I would like to know what is the exact technical difference between these two types.
Krishna
  • 7,154
  • 16
  • 68
  • 80
63
votes
9 answers

Is WordPress MVC compliant?

Some people consider WordPress a blogging platform, some think of it as a CMS, some refer to WordPress as a development framework. Whichever it is, the question still remains. Is WordPress MVC compliant? I've read the forums and somebody asked about…
kovshenin
  • 31,813
  • 4
  • 35
  • 46
62
votes
5 answers

MVC tutorial that doesn't rely on a framework?

I want to learn MVC "architecture pattern" but I don't want to jump into a framework like Rails or Django just yet. I want to understand the concept first and write some simple code in my currently familiar environment, which happens to be…
Ixion
  • 745
  • 1
  • 7
  • 8
61
votes
6 answers

Show JDBC ResultSet in HTML in JSP page using MVC and DAO pattern

I'm implementing MVC using JSP and JDBC. I have imported a database class file to my JSP file and I would like to show the data of a DB table. I don't know how I should return the ResultSet from the Java class to the JSP page and embed it in…
Ashwani Sharma
  • 629
  • 1
  • 6
  • 3
61
votes
3 answers

Vue.js run a code in mounted and again for restart functionality

I am creating a game in VueJS, where, when the page loads, I want a method to fire, make an ajax call to an external API and create a bunch of data properties. When the player wins the round, I want to them to be able to see a button that allows…
lnamba
  • 1,681
  • 3
  • 18
  • 26
61
votes
7 answers

TypeScript exports is not defined

I'm trying to use export and import but it not working I get an error Here is my code HTML :
Iris
  • 1,436
  • 3
  • 14
  • 29
61
votes
6 answers

Android How do I correctly get the value from a Switch?

I'm creating a Android application which uses a Switch. I'm trying to listen for changes and get the value when changed. I have two questions when using switches: What action listener do I use? How do I get the the switch value?
stackoverflow
  • 18,348
  • 50
  • 129
  • 196