jeudi 31 décembre 2020

Observer pattern - multiple reasons to observe a Subject

How could we implement the observer design pattern if a Subject is observed for multiple reasons? For example, a weather station is observed by a object that tracks the temperature and by another object that wants to be notified when the forecasts changes.

I would like to stay as close as possible to the UML diagram of the pattern presented in the gang of four's book.

enter image description here

Aucun commentaire:

Enregistrer un commentaire