MVC -- Explained!

Posted by elaineparie on March 1, 2019

MVC stands for Model, View, Controller. It is a pattern of backend programming that separates the application into three main components: the model, the view, and the controller.

Each of these components have separate aspects of the application.

A way to imagine the process is like a chef, waiter, and table.

The controller is the waiter. A waiter takes and order from the customer to the chef and then delivers food to the table. In the same way, the controller transmits requests from user to the model and then to the view.

A chef is responsible for preparing the food. This is the Model. The model holds the logic of the app, and it is in the model that objects are created before they are sent back to the controller and onto the view.

The view is the table. Like a table holds the prepared plates of food, the view should not contain any logic, but rather is just what the viewer sees.