observer pattern cs542 assign3