Question

simple question, what are the common practices to let the application entities communicate with a MVP triads?

I understand that all the user interactions happen through the view and this is clear to me. I understand that the MVP can be created through a factory, once the view is created the presenter can be injected or created with a new by the view (at least in one of the many variants).

I understand that the model can update the view through databinding or through events, not really important.

I understand that the presenter can drive the application through commands and dependency injection (or events).

What I am not sure about is what if I have to change the view once something happens in the application that is not user driven? How do I communicate to the presenter that something must change in the view?

This is just a philosophy/curiosity question, just to know what the best practices are regardless the framework used.

Was it helpful?

Solution

Use events. Take a look at Event Aggregation.

If presenters communicate with one another via events, the whole thing stays nice and loosely coupled.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top