Observer pattern implemented with a demo