Back to notes -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'        Slide program -- Keyboard shortcut: 't'    Application of the Subject and Observer classes.Lecture 6 - slide 19 : 20
Program 3
using Templates.Observer;
class Client {

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

     subj.AddNotifier(o1.Update);   
     subj.AddNotifier(o2.Update);   
                                    
     subj.Notify();    
  }
}
 
 
 
 
 
 
 
 
 
Add the Update methods
to the observerNotifier
event of the subject.