Model View Controller https://www.asp.net/mvc/overview/getting-started/introduction/getting-started
Introduction MVC (Model View Controller) uses a common design (architectural) pattern to build web applications We could have an endless talk about design patterns Refer to the GOF It’s not a new concept. MVC was introduced in the late 1970s
My MVE Comments The design pattern and concepts are abstract and can be hard to grasp However, they are really everywhere HTML – model CSS – view Browser – controller https://blog.codinghorror.com/understanding-model-view-controller/
MVC (Model) The model knows things The model implements application logic Models represent knowledge and a way to store it The model gets requests from the controller and sends back data
MVC (View) A view is a visual representation of a model The view shows the things the model knows It’s often called a presentation filter The view gets its data from the model through the controller and is responsible for rendering
MVC (Controller) The controller plays the largest role It’s the link between the user and the system It gets commands (requests) from the users and tells the model what to do and the view what to show It sends requests to the model and gets back data That data is passed on to the appropriate view
MVC The Model From Wikipedia
MVE Implementations MVC has crept into many frameworks Android is MVC by design ASP is doing more and more Ruby on Rails is “very” MVC
MVC and ASP MVC 4 is the version supplied with VS 2012 MVC 5 is supplied with VS 2013 and later We will use MVC 5 MVE 6 is close to complete
Reasons to use MVC Easy to test Component-based Modules are very plug and play There is no view state or server forms It’s up to you
Reasons NOT to use MVC It’s complicated You must live in the MVC structure And not all applications are MVC applications They don’t fit the model