Define the roles of Model, View, and Controller
In an MVC architecture, each component has a specific responsibility:
- Model: Handles data operations. It receives instructions from the Controller, performs actions on the database, and returns the resulting data to the Controller.
- View: Handles the presentation layer. It takes data provided by the Controller to generate the HTML structure and final web page content.
- Controller: Acts as the intermediary bridge. It receives requests from the browser, coordinates the interaction between the Model and the View, and sends the final response back to the browser.