Observer design pattern
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| C# Design Patterns |
|
| edit |
| C# design pattern in a nutshell | |
| The Observer design pattern defines a one-to-many dependency between objects. So, when an object changes state, all its dependents are notified and updated automatically.. | |
The Observer design pattern .
Use the Observer pattern when
- an abstraction has two aspects—each one dependent on the other. Encapsulating these aspects into separate objects lets you vary and reuse them independently.
- a change to one object requires changing othersl; but, you don't know how many objects need to be changed.
- an object must be able to notify other objects without making assumptions about what these objects are—loosely coupled.
| C# design pattern at a glance | |
|
Observer designs subjects and observers to be loosely coupled. It
|
Observer is useful for listening for changes of state, for example:
|
[edit]
Classic Observer design pattern
|

