Example of Observer pattern