Almo
Almo

Reputation: 15861

Is it a no-no to have one presenter call a method on another presenter in a Model-View-Presenter application?

I have a presenter that recenters a view. It is BTCanvasPresenter which has a reference to a view called a BTCanvas.

I'm making another presenter, MainMenuPresenter, which deals with the menu strip items. One menu item recenters the BTCanvas. The menu events used to be in the form of the main window. I'm moving them to MainMenuPresenter.

So my question is, should MainMenuPresenter call RecenterView on BTCanvasPresenter? Should BTCanvasPresenter handle that menu event? Should MainMenuPresenter get a reference to BTCanvas so it can call the view's Recenter method itself?

Upvotes: 1

Views: 623

Answers (1)

Paul Nikonowicz
Paul Nikonowicz

Reputation: 3903

It is ok to have a presenter listen to more than one view/model, but try not to have the presenters call each other, it doesn't lead to an intuitive design.

Upvotes: 2

Related Questions