Erica [email protected]

MVC divides the application into three distinct parts, where each has a single responsibility:

  • Model: The model represents the data and business logic we are modeling.
  • View: The view represents what the user sees. In the context of REST APIs, that usually is a serialized data structure.
  • Controller: The controller represents a key component of MVC. It orchestrates the flow between the client request and the server response. The primary role of the controller is to act as an HTTP bridge. Essentially, the controller facilitates the communication in and out of the system.

The code of a controller should remain minimalistic and not contain complex logic, serving as a thin layer between the clients and the domain.