The general question is about the presenter model (C #), should the model know the presenter?

I have an MVP setup (passive view) and everything is going well. I recently read Martin Fowlers’s description (http://martinfowler.com/eaaDev/PassiveScreen.html) and he writes: “Another advantage is that Passive View is a very explicit mechanism. It relies very little on Observer mechanisms or declarative comparisons” .

In my MVP, I have my model, completely ignoring the host, and the connection with the host model is handled by events. I initialize my MVP in the view by calling the ctor presenter, for example. new presenter (this is the new model ()) (where this relates to the view).

My question is: should I make the presenter aware model such that it can invoke the presenter logic directly and not use events?

+5
source share
1 answer

No, not worth it. If you did, your model would be closely linked to your presentation layer, which would render it useless outside of this context. Moreover, testing, debugging and supporting your model layer will become more problematic.

+6
source

All Articles