April 2018
Intermediate to advanced
396 pages
11h 8m
English
For the class diagram, let's focus on the following example—we have a website with posts, and people can subscribe to get notifications whenever a new comment is added. The following diagram shows how something like this could be represented using the observer design pattern:

The Post class is our observable, and it has observers of the User type that are notified whenever the post changes (in our case, when a comment is added).
Note that the preceding scenario is just an example. In reality, subscriptions can be done in a database and people will receive an email notification. However, if we are talking about some kind ...
Read now
Unlock full access