Design patterns implementation examples

Observer

Definition:

Sends information to objects interested in its state changes.


Example:

For instance we are interested what's new on some website, so we just subscribe it. Now will be informed about any change by e-mail.


C++ code:

/src/observer.cpp
Download source code

Observer UML class diagram:
Observer UML class diagram

Observer UML sequence diagram:
Observer UML sequence diagram