3
votes

i am wondering about the difference between the two mentioned patterns. when you consider, that you need synchronization code in the presentation model pattern and that code is in the presentation model itself, then i think the patterns are quite similar.

Both delegate events to the presentation model / presenter. presentation model and presenter command the domain model and do also observe the domain model. on occuring changes, they both sync with the view (since the synchronisation code in the presentation model is in the presentation model).

in my opinion the difference is, that presentation model is an abstract form of the view. it describes the state and behavior of the view. so it has properties for all view state information. and this information is synched via sync code. in passive view, the presenter is not nessessarily seen as an abstract form of the view. so the presenter does not nessessarily have properties representing the view state. so the presenter does not "sync" the states (perperties on controls and the presenter itself). instead he simply "copies" (on changes) domain data to the controls. so the difference is in essence the abstraction of the view, that presentation model provides while in passive view the presenter coud be seen as a data mapper for domain data.

is that ok so far or do i miss something important?

thanks and best regards patrick

1

1 Answers

2
votes

My understanding is that Passive View is a variant of of MVP and Presentation Model is a separate pattern.

As you've highlighted Presentation Model has an abstract representation of the view, later called a ViewModel in MVVM. MVP has no stateful representation of the view, the presenter calls the view accordingly. Passive View means that the view calls are generally agnostic of any domain concepts, so largely primitive types. Whereas the Supervising Controller variant allows the view to be passed domain concepts that it can interpret.

As I've said, this is just my understanding. I'm happy to be corrected.