| Application of the Subject and Observer classes. | Lecture 5 - slide 44 : 45 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. |