Loading...
Loading...
By continuing to use the platform, you accept the terms of the Privacy Policy and the use of cookies.
MVC (Model-View-Controller) and MVP (Model-View-Presenter) are architectural patterns that help organize code in large applications. They separate application logic into separate components, making it more understandable, maintainable and testable.
Model-View-Controller is one of most popular patterns. It divides application into three layers:
Model
View
Controller
Data Flow Example:
User ➜ View ➜ Controller ➜ Model ➜ Controller ➜ View
MVC Features:
Model-View-Presenter is evolution of MVC that facilitates testing and stronger isolates View.
Model
View
Presenter
Data Flow Example:
User ➜ View ➜ Presenter ➜ Model ➜ Presenter ➜ View
| Characteristic | MVC | MVP |
|---|---|---|
| Who manages logic? | Controller | Presenter |
| View knows about Model? | May know | No |
| Model knows about View? | No | No |
| Testability | Medium | High |
| Where used | Web frameworks, backend | Android, desktop, complex UI |
| Scenario | Approach |
|---|---|
| Simple application with minimal logic | MVC |
| Large application requiring modularity and testability | MVP |
| Android development or limited UI | MVP |
| React / Vue / Angular | Often uses MVVM or FSD, but principles are similar |
Useful to Know:
In modern frontend variations of these patterns are more often used: MVVM, Redux, Flux and Feature-Sliced Design (FSD) architecture.