What Is MVC?

February 5, 2023

☕️ Support Us
Your support will help us to continue to provide quality content.👉 Buy Me a Coffee

MVC is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components are built to handle specific development aspects of an application.

What is MVC pattern?

MVC is an architectural pattern that separates an application into three main logical components: Model, View, and Controller. Each of these components are built to handle specific development aspects of an application. The design logic is to separate the "logic processing" and the "data presentation" parts, clearly distinguish the functions of each component, which makes it easier to extend, improve usability, and each team member can do development without affecting each other.

MVC model
MVC model

MVC interaction pattern as shown above, and each component represents:

Model

The model is responsible for communicating with the database (such as: accessing data), it is not dependent on View and Controller, that is, Model does not care how the data is displayed and operated.

View

View is responsible for managing the display of data, without any program logic. Corresponding to web development, it is the HTML template.

Controller

Controller is responsible for the interaction with client, and is the bridge between Model and View. Controller will get data from Model, and pass the data to View to generate HTML template, and return the HTML page with data to client.

☕️ Support Us
Your support will help us to continue to provide quality content.👉 Buy Me a Coffee