The Model, View and Controller - MVC | Lecture 2

The Model, View and Controller - MVC | Lecture 2

Video Lecture on the Topic :

What is Architectural Pattern :

The main purpose of any architectural pattern in software and web application world is to provide the solution of reoccurring problems.

Different Architectural Patterns:

There are a lot of different architectural patterns available in the market Layered Pattern, Client-Server pattern and peer-to-peer patterns are the few examples of the architectural patterns. Out of all the pattern the most commonly known pattern is the MVC (Model View Controller) pattern. This pattern is becoming famous in the field of Web application development and know all the web application development platforms are officially providing the support of this pattern. In the next few minutes we will be discussing in details how the MVC architectural pattern works and what are its benefits.

How MVC Pattern works ?

As name shows this pattern works on the basis of the 3 parts M- Model, V-View and C-Controller. So to make the application MVC supported in we simply divide the application into these three categories. Note : To implement MVC at application level we create three folders Model, View and Controller folder and these folders contains the files which are related to them.

Model :

This part of the pattern holds the logical Functionality files of the application, holds the business logic or data-related logic code. Let say I have a class Student with the properties ID, Name, FatherName, RollNum, DoB and other properties I will put it into the Model Folder.

Views :

This folder contains the UI related stuff, lets say you create an interface having TextBox, DropDown list and etc that complete file will fall under this category.

Controller :

This component is responsible for taking user input request from Views, Asking for some data to Model, taking back data from model sending back to the View for the user. It is something between the Views and Models it serves the other component and control the flow of the data in between these components.

Disadvantages of MVC :

Well it makes the application development easy and fast but like every other Pattern MVC pattern also have disadvantages I am not going into depth but the one of the biggest disadvantage is for a new user it is a little bit difficult to understand and it is a little bit complex on implementation level but provide value on long term basis.

MVC in .NET Platform:

Well as I discussed earlies nowadays every other web development platform like python, php .NET (Microsoft) is providing support for this architectural pattern but out of all these MVC support in .NET platform specifically in .NETCore is really appreciable and easy as well to understand and learn.

Developing ASP.NETCore MVC based application is really fun and smooth experience.