title: c++ "bi-directional" observer pattern
body: <p>I've been reading about how to implement proper MVC in a C++ application and basically came to the point that there are 2 ways of implementing this : </p>
  
  <ul>
  <li>observer pattern </li>
  <li>signal/slot </li>
  </ul>
  
  <p>However, in both cases, the exemples I read all follow a structure in which the subject can change and notify it's observer(s), but the observer never changes the subject. Now this cases arises a few "problems".</p>
  
  <p>Let's say I have a class called Text (a model component), another classed called TextEditor (a GUI component) which someway displays 'Text' AND should be able to modify it and a few other classes which can modify the 'Text' as well .</p>
  
  <p>Right, so I use observer pattern, make 'Text' the subject and 'TextEditor' the observer. No big deal.</p>
  
  <p>If 'Text' is changed in some way, Text calls Text::notify() and my TextEditor will reflect the change. Fine. </p>
  
  <p>Now, what if I use the TextEditor to modify the Text ? </p>
  
  <p>'TextEditor' knows about 'Text', so it calls something like textInstance.setText(...) 
  ...and at the end of setText, 'Text' calls notify, and 'TextEditor' is notified of a change it made itself ! 'Text' cannot even send a notification to everybody except 'TextEditor' because it's not suppose to know about it's observers ! </p>
  
  <p>I've got the feeling that this is not right, not "clean" even performance-reasons asside .
  I'd bet there's a better way to implement this but I'm stuck. Anybody has hints ? </p>
  
  <p>I'm not realy looking to a pre-made C++ implementation, but more to an understanding of how I should see things correctly.</p>