views:

26

answers:

2

I have two views each with their own presenters and they need a two way communication between them. Like if the user name changes in View A, presenter A needs to notify presenter B of the change and vice versa. Should I create a high level presenter/eventHandler that gets notified when either A or B needs to trigger an event or is there a better way?

A: 

Note that the two types of events that is the one triggered from A->B and the one from B->A are different event types.

kens
A: 

I believe your views should not communicate directly to each other, rather both should listen to changes in, and propagate changes to, the common model (via the Controller). This is the idea behind the Model-View-Controller pattern. The high level event handler you mention is equivalent to the Controller in the pattern.

Péter Török