Spring MVC and Web Layer
August 7, 2021

M05 Q01 MVC is a design pattern. What does it stand for and what is the idea behind it?

MVC stands for Model-View-Controller, it is a design pattern which divides application into three main interconnected component types.

Now let's trace how the request layer is being handled in the MVC application.

So the user is usually is a source of the request. Once the user makes a request the controller is responsible for handling the requests. Then controller interacts with a model and manipulates the model. The data is being taken from the model and also the controller is deciding what view to use. After having a view to use the data has been rendered with the usage of the view. And then the response has been passed back to the user.

Now let's look what kind of components we can use from Spring MVC. Spring MVC introduces ready-to-use components that you can use in your application for MVC pattern.

Usage of MVC design pattern has following advantages:

  • Separation of concerns
  • Increased code cohesion
  • Increased code reusability
  • Reduces coupling between data, logic and information representation
  • Lowers maintenances costs
  • Increases extendibility

Cohesion is a metric that tells you how well your application is structured logically.