What is MVC
MVC is a design pattern that divides an application into 3 parts: data (model), Presentation layer (view), and
User interaction Layer (Controller). In other words, the occurrence of an event is such a process:
1. Interact with users and apps.
2. The controller's event handler is triggered.
3. The controller requests data from the model and gives it to the view.
4. The view renders the data to the user.
Now look at a real example, figure 1 shows how to send a new chat message in Holla.
1. The user submits a new chat message.
2. The controller's event handler is triggered.
3. The controller creates a new chat model record.
4. The controller then updates the view.
5. The user sees a new chat message in the Chat window.
We can implement this MVC schema pattern without a class library or framework. The key is to have each part of MVC follow
Responsibilities, dividing the code clearly into sections and maintaining good decoupling. This makes it possible for each department
Independently developed, tested and maintained separately.
What is MVC?