Event is actually just a keyword that you place in front of a delegate to prevent an outside class from invoking said delegate or tampering with the delegate’s invocation list ( except to subscribe / unsubscribe itself ) In this…
Event is actually just a keyword that you place in front of a delegate to prevent an outside class from invoking said delegate or tampering with the delegate’s invocation list ( except to subscribe / unsubscribe itself ) In this…
2 issues in our previous example ( See Implementing the Observer Pattern via Delegates post ) 1. I can invoke the TrainSignal delegate directly This means the TrainSignal object will tell subscribers that a train is coming when it’s not…
What is the Observer Pattern ? Make use of the Observer Pattern in situations where 1. You have an object -> Object A 2. Object A has 1 or more dependent objects -> Object A, Object B and Object C…