---
description: Model View Controller
---

# MVC

* **MVC** is a pattern in software design commonly used to implement **user interfaces**, **data**, and **controlling logic**.&#x20;
* It emphasizes a separation between the software's business logic and display. This "**separation of concerns**" provides for a better division of labor and improved maintenance.

The three parts of the MVC software-design pattern can be described as follows:

1. **Model**: Manages data and business logic.
2. **View**: Handles layout and display.
3. **Controller**: Routes commands to the model and view parts.

## Components&#x20;

### Model

* The model defines what data the app should contain.&#x20;
* If the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if different logic is needed to control the updated view).

### View

* The view defines how the app's data should be displayed.

### Controller

* The controller contains logic that updates the model and/or view in response to input from the users of the app.

{% embed url="https://www.interviewbit.com/mvc-interview-questions/" %}
