Arman Hatefi
Arman Hatefi

Reputation: 43

Difference between MVVM and MVA (Model-View-Adapter)

What is the difference between MVVM and MVA (Model-View-Adapter)?

As long as in both patterns:

  1. The VM and Adapter mediate between View and Model.
  2. There could be more than one VM and Adapter participated in these patters for the same model.
  3. The model interacts directly with VM and Adapter.

The only thing that comes to my mind is that in MVVM, VM will not receive any notifications from Model, but in MVA the adapter receives notifications from Model!

So how the difference of these patterns can be explained?

Upvotes: 1

Views: 1586

Answers (1)

David Osborne
David Osborne

Reputation: 6791

In this article, Martin Fowler outlines the Presentation Model pattern, of which MVVM is, arguably, a derivative.

I'm not that familiar with the MVA variant but assuming it has similar qualities and objectives of MVP, making it comparable.

The key difference between the Presentation Model pattern and the other variants of MVP are highlighted in the quote below.

Presentation Model is a pattern that pulls presentation behavior from a view. As such it's an alternative to to Supervising Controller and Passive View. It's useful for allowing you to test without the UI, support for some form of multiple view and a separation of concerns which may make it easier to develop the user interface.

Compared to Passive View and Supervising Controller, Presentation Model allows you to write logic that is completely independent of the views used for display. You also do not need to rely on the view to store state. The downside is that you need a synchronization mechanism between the presentation model and the view. This synchronization can be very simple, but it is required.

Upvotes: 0

Related Questions