observer pattern for mainview