MVC
MVC
ELI5 — The Vibe Check
MVC is like a restaurant: the Model is the kitchen (data and logic), the View is the plate of food (what the user sees), and the Controller is the waiter (takes orders, talks to the kitchen, brings back food). They each have one job and stay in their lane.
Real Talk
Model-View-Controller is an architectural pattern that separates an application into three components: the Model manages data and business logic, the View renders the user interface, and the Controller handles input and orchestrates the flow between Model and View.
Show Me The Code
// Controller
app.get('/users', async (req, res) => {
const users = await User.findAll(); // Model
res.render('users/index', { users }); // View
});
When You'll Hear This
"Rails follows MVC by default." / "Put that logic in the model, not the controller."
Related Terms
Architecture
Architecture is the master blueprint for your app — like deciding whether to build a house, apartment block, or skyscraper before laying a single brick.
MVP (MVP)
An MVP is the simplest version of your product that actually works well enough for real users to use and for you to learn from.
MVVM (MVVM)
MVVM is MVC's cooler cousin for UI-heavy apps.
Separation of Concerns
Separation of Concerns means different parts of your code should handle different concerns and not step on each other's toes.