3

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

offline
  • 141
  • 7

1 Answers1

2

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.

David Osborne
  • 6,052
  • 1
  • 19
  • 32
  • Hi David, yes, they are definitely seperate patterns. but in general i think they are very similar if you use presentation model with "manual data binding" by having synchrinization code in the presentation model like in the example here: http://martinfowler.com/eaaDev/PresentationModel.html what do you think? – offline Aug 30 '13 at 17:16
  • I'd agree that using a 'manual' approach to updating the data makes them more similar. However, I still think the key difference is MVP's lack of a discreet class/model/concept that represents the current state of the view. – David Osborne Sep 02 '13 at 08:00
  • Hey David, i agree. the key difference is, that the state is in the presentation model. it is an abstraction of the view. this is not the case with MVP. the rest seems to be an implementation detail. i think i first thought into this direction because of the notion of the presentation model in this article: http://martinfowler.com/eaaDev/uiArchs.html at the end of the MVC part. here, the fundamental difference is not so clearly mentioned as in the introduction of http://martinfowler.com/eaaDev/PresentationModel.html – offline Sep 02 '13 at 17:38