Original Post
hi there. my design started out like that: class A holds a pointer and the pointed-to data could be changed by different controllers. class A holds n controllers (concrete controller classes). controllers can be registered, unregistered and updated. controllers change that member of class A over a certain time, so soon i needed a functionality where controllers can unregister themselves after the time is over. i didn't want the controller classes to know about class A (to ensure loose coupling) so i introduced a boolean "shouldDie" flag. class A checks that flag before every controllersUpdate() if a controller should be deleted and in case deletes them. but now i need one of the controllers to not only update the pointed-to data but also the pointer itself when the before mentioned time is over. eventually other controllers should be informed of that pointer change. is there an elegant way (read: any pattern) to accomplish that or do i finally need to let the controller know about class A? thanks in advance! [Edited by - ghostd0g on January 15, 2007 10:23:17 AM]