Slide 36
Slide 36 text
MVC (Model-View-Controller)
• When you need to separate the concerns of an application into three interconnected components:
Model (data and logic), View (presentation), and Controller (user input handling).
• When you want to improve maintainability and modularity by decoupling the user interface from
the application logic.
• Model represents the application's data and business logic.
• View displays the data to the user and handles user interface elements.
• Controller handles user input, updates the model, and communicates with the view.
• The model notifies the view of changes, and the view updates itself accordingly.
• The controller acts as an intermediary between the model and view, facilitating user interactions.
Problem
Solution
A blue circle with a white chain in it
Description automatically generated
Think of a restaurant. The kitchen (Model)
prepares the food, the waitstaff (Controller)
takes orders and serves food, and diners
(View) see and interact with the food.
The MVC pattern separates an application
into three interconnected components:
Model (data and logic), View (presentation),
and Controller (user input handling).