Thought Programmer
MVC vs MVP vs MVVM
What’s different between them?
Nowadays we have many options when it comes to architecture design patterns. After developing many apps using Model-View- ViewModel (MVVM), Model-View-Presenter (MVP), and Model-View-Controller (MVC), I finally feel qualified to talk about the differences between them. For easier to understand, we can use a simple example like developing a screen to search books in the BookSearch App.
Let’s begin now…!
MV(X) essentials
First of all, we need to understand briefly MVC, MVP, and MVVM architecture before dive into them.
Why Model-View-(C or P or VM)?
The aim of these architectures is to separate the responsibilities of visualizing, processing, and data management for UI applications.
Their goals are to increase.
- Modularity
- Flexibility
- Testability
- Maintainability
Model-View-Controller
Or MVC for short is a widely used design pattern for architecting software apps. The pattern was originally designed by Trygve Reenskaug during his time working on Smalltalk-80 (1979) where it was initially called Model-View-Controller-Editor. MVC went on to be described in depth in “Design Patterns: Elements of Reusable Object- Oriented Software” (The “GoF” book) in 1994, which played a role in popularizing its use. The pattern breaks an app up into three components.
- Model — is responsible for the business logic of the application. It manages the state of the application. This also includes reading and writing data, persisting application state, and it may even include tasks related to data management such as networking and data validation.
- View — this component has two…