Easy understanding of MVC design architecture
There are lots of principle and methodology in software engineering field. Through this blog I am going to describe MVC design pattern.
Real life example :
Real life example :
Let's consider you are going to buy a suit for your wedding. You supposed to go your favorite tailor's shop and choose your desired suit's design which is shown by helper boy. Helper boy handed over the chosen design to that tailor(Controller). Tailor collect the suitable items such as cloths material, needle, thread, button ,zip (Model collect the information from database).Then tailor stich the suit and give it to helper boy(VIEW). Helper boy pack that suit with covered bag and give it to you.
The same scenario is happening in MVC design architecture.
MVC is an architectural design pattern. It's separate application into three main different components such as Model, View, Controller. These components are having specific functionalities.
Model
Model is simple class. It's contain business logic of the application. It's used to display the data in view page and also it's represent application's data structure. It helps to update or change data to controller and view.
View
This is the actual website which show to user. It is displaying entire data what user wants to see using model.It contain HTML code. User used to create a request through view.
Controller
Controller is the major part of the MVC design pattern. It's handle the user request with a help of Model and response to View. Controller used to work with HTTP request which is coming from client, browser or from another application. And also Controller act as a bridge between Model and View.
Now, you might be get clear understand about MVC (Model View Controller). Let's check what are the advantage of this MVC design pattern.
Advantages of MVC design pattern.
It has ton's of advantage. I'm going to point out some major advantages.
- Main advantage of MVC is separation of concern (SOC).It's provide clean separation between UI(View) , Business logic , Data (Model).
- Due to the separation of Model, multiple view page can possible from same data at the same time.
- MVC is a lightweight application.
- Testability.
Comments