Uml Model Of The Observer Pattern. Besides other well known patterns such as the visitor pattern or the singleton pattern the observer pattern belongs to this collection of practical design patterns. Subject represents the core or independent or common or engine abstraction.
I am just a bit confused with the difference between the observer and state pattern. Now lets look at the uml diagram of the observer design. You may end up pushing a lot of not needed information to the observers push model example.
The observer pattern is a software design pattern in which an object named the subject maintains a list of its dependents called observers and notifies them automatically of any state changes usually by calling one of their methods.
In your example the network is the observer that wants to know about the. Besides other well known patterns such as the visitor pattern or the singleton pattern the observer pattern belongs to this collection of practical design patterns. The observer pattern is mostly used when you have an object or a set of objects known as the observers that want to be informed updated about any changes in the state of one or more objects known as the observables or subjects. When subject changes its state all the observers are notified automatically.