MVVM
MVVM
ELI5 — The Vibe Check
MVVM is MVC's cooler cousin for UI-heavy apps. The ViewModel is a translator that sits between your data and your screen — it transforms raw data into something the UI can show, and pushes UI events back to the data. Vue and Angular love this pattern.
Real Talk
Model-View-ViewModel separates UI logic from business logic using data binding. The ViewModel exposes data streams and commands that the View binds to declaratively, eliminating the need for the View to know about the Model directly. Common in Angular, Vue, and WPF applications.
Show Me The Code
// Vue MVVM - ViewModel
const useUserViewModel = () => {
const user = ref(null);
const displayName = computed(() => `${user.value?.firstName} ${user.value?.lastName}`);
return { user, displayName };
};
When You'll Hear This
"Vue naturally follows MVVM." / "The ViewModel handles all the UI state transformations."
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.
MVC (MVC)
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 (...
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.