0

I have some Views and Presenters. In my architecture, they have a circular dependency, so the View has a reference to the Presenter and vice-versa.

Now, which is the more commonly used:

class View
{
    View()
    {
        this.Event += presenter.EventHandler;
    }
}

or:

class Presenter
{
    Presenter()
    {
        view.Event += this.EventHandler;
    }
}

Or maybe it's pretty much the same thing? If not, what are the pros and cons of each?

1 Answer 1

2

In terms of coupling, the View should not know anything about the Presenter. Ergo, the presenter (or some third-party object) has the responsibility of hooking up the necessary events.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.