title: how to implement this observer pattern?
body: <p>I have 4 classes, that describe state diagram. <code>Node</code>, <code>Edge</code>, <code>ComponentOfNode</code> and <code>ComponentOfEdge</code>.</p>
  
  <p><code>ComponentOfEdge</code> compounds from <code>ComponentsOfNode</code>. <code>Node</code> can have 0..n outgoing edges. <code>Edge</code> can have only 2 <code>Nodes</code>.</p>
  
  <p><code>Edge</code> should be able to offer <code>ComponentOfNode</code>, but only from <code>Nodes</code> that <code>Edge</code> has, in the form of <code>ComponentOfEdge</code>.</p>
  
  <p>The user can change <code>ComponentsOfNode</code>. I need this change spreads to all <code>Edges</code>. How would I do it? I expect the observer pattern should be used.</p>
  
  <p>Can you give me an example in pseudo-code please?</p>