To overcome the problems mentioned in the previous chapter MVC is introduced. Simply, MVC is Flexible and Extensible. MVC have the good testability.
The following diagram shows the architecture of the MVC.
Architecture
The following are the three important terms which are shown in the above diagram.
Model: Responsible for maintaining data.
View: Used to display the information to the end user.
Controller: Controller is the heart of the MVC. Controller controls the interaction between Model and the View through the code.
Any kind of request, requested by the end user has to hit the controller first. Then only, the request will pass to the model and the view.