S
S
sanke462018-09-24 19:56:55
Design patterns
sanke46, 2018-09-24 19:56:55

What is the difference between MVVM and MVP?

Hey guys :-) I may have a trite question but very important for me :-)
What is the difference between "MVVM" and "MVP" ?
As I understand it (MVVM):
- Model [data]
- View [processes the visual part]
- ViewModel [processes the logic for the view using model (may have an additional class for processing data binding)]
As I understand it (MVP):
- Model [data binding]
- View [handles the visual part]
- Presenter [handles the logic for the view using the model]

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Anton Spirin, 2018-09-25
@sanke46

Differences between MVVM and other MV* patterns

M
Maxim Marashan, 2019-09-18
@mmarashan

How I structured it for myself.
MVC: View and Controller have access to data (Model). That is, the View can redraw itself only on the basis of data changes in the Model or user interaction with the View (clicking on the screen), or it can change the data in the Model itself; and only tell the controller about it. The Controller can change the state of the View based on its data sources (eg external requests, button clicks) and can also change the Model.
MVP: Presenter is an intermediary between View and Model. View and model are exchanged with data through the established API. The display in the View depends only on the data that the Presenter has set.
MVVM: ViewModel is also an intermediary between View and Model. But the ViewModel cannot directly affect the View, but is only a data source and has the ability to transfer actual data through call functions. What to display is determined at the View level.

M
MrBinWin, 2019-12-20
@MrBinWin

The key difference is that in MVVM ViewModel contains state (state), while Presenter in MVP does not.

R
Roman Zhak, 2015-05-08
@romanzhak

https://phaser.io/ - powerful framework with excellent state manager, good documentation; many examples.

M
Misha Kogan, 2015-05-15
@Kogan4ik

Not an expert in python, but I think the same as with simple sites with a backend.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question