🏗️Model-View-Controller (MVC)
Also known as MVC, MVC Pattern, Model View Controller
Splits an app in three: data, screens and the code that links them.
Think of it like
Think of it like a cafe. The kitchen has the food and the counter shows it. The waiter takes orders between them.
Example
On Emma's blog, clicking a post goes to a controller. It asks the post model for the text and hands it to the post view, which draws the page.
Why it matters
It is the shape of many popular web frameworks. Knowing it tells you where to find each part of the code.
Definition
Common mistake
Key takeaways
- 1Model. Data and rules.
- 2View. What the user sees.
- 3Controller. Turns clicks into actions.