Is it desirable (from an architectural standpoint) to have more than one Presenter communicating with a View?
In my particular situation I have one presenter communicating with multiple views, and each of those views have their own presenter. In other words, each view has two presenters.
It would be feasible to use inheritance instead; in other words, having a parent presenter and child presenter.
-
It's not desirable IMO although I've seen it done. mostly to handle application workflow, e.g. which views get displayed in which order in a wizard. What problem does it solve for you ?user1450877– user145087710/26/2017 11:58:19Commented Oct 26, 2017 at 11:58
-
1Sounds like a solution in search of a problem. Unless you have a problem you think it might solve...Robert Harvey– Robert Harvey10/26/2017 16:32:00Commented Oct 26, 2017 at 16:32
1 Answer 1
The presenters job is to transform messages and data into something the view can use. It sounds like your views have two areas of concern: one unique, one duplicated.
Rather than reaching for inheritance why not let your unique presenters hold a reference to your duplicated presenter and simply reuse it? This will mean more keyboard typing than inheritance but it will keep things flexible, readable, and avoid the yo-yo problem.
Explore related questions
See similar questions with these tags.