1

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.

2
  • 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 ? Oct 26, 2017 at 11:58
  • 1
    Sounds like a solution in search of a problem. Unless you have a problem you think it might solve... Oct 26, 2017 at 16:32

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.