Back to slide -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'                patterns/observer/template/client.cs - Application of the Subject and Observer classes.Lecture 5 - slide 42 : 45
Program 3

using Templates.Observer;
class Client {

  public static void Main(){
     Subject subj = new Subject();
     Observer o1 = new Observer(subj),
              o2 = new Observer(subj),
              o3 = new Observer(subj);

     subj.Attach(o1);  // o1 subscribes to updates from subj
     subj.Attach(o2);  // o2 subscribes to updates from subj

     subj.Notify();    // Following some state changes in subj
                       // notify observers
  }
}