MVC is a software development Pattern/Paradigm that stands for Model, View, Controller
It is a general Pattern that applies to all environments (Linux or Windows), backend language (Php, Ruby, C#, Python, JS).
The point in MVC is to split applications or components into well-defined sections that all do a specific job.
The Model defines all of the data that the component will use, and the model interacts with the database to save data, it’s a best practice that the Model will be the only part of the application that handles data logic and interacts with the database.
The Controller deals with user requests and will behave like a man-in-the-middle between the Model & the View controlling what it is that they do. Generally, the controller should not interact with data, it will always pass the request on to the Model to handle the data logic there.
The View, as Frontend developers this is where we mainly work. The View handles data presentation for the user, so this part defines what the application looks like. The view will render HTML and is usually written in a templating language, like Razor in dotnet, Twig in PHP, Liquid in Ruby, or Handle Bars in JS applications.
Quick Video:
If you want to read more:
Tom Dalling – Model View Controller Explained
Real Python – The Model View Controller Paradigm Explained With Legos
Working in DotNet there is one thing that makes the acronym MVC harder to google for is it has a specific meaning in DotNet land. Microsoft created ASP.net MVC which is actually the name of a framework, this is basically the paradigm applied to .net but it has some stricter rules. As Frontend Devs we don’t need to concern ourselves with the implementation details of ASP.net MVC because creating ASP.net code is a backend developers job, although it can be helpful to get an overview of how it works to demystify backend work.
The Microsoft documentation is way too dry for me, and every time I try to look at something there it gives me a headache… 🤨
There’s a simple step by step tutorial here to skim over if you want to know more:
Comments
Add your comment