public void Notify(object sender, string ev) { if (sender is ConcreteComponentA) { _componentB.ReceiveMessage(ev); } else { _componentA.ReceiveMessage(ev); } }