Original Post
i'm trying get the design of my "engine" clean and theres something i don't like but don't know how to solve... problem: i got plenty of game objects. think of sth. in the scale over 200.000. no, i'm not trying to process them every frame. most of them are static and require attention only on con/de-struction. most of the rest also doesn't need to be processed that often, maybe every few seconds. i itentionly thought of the observer pattern to hook them up with graphis, sound and the like. since this would create an extreme memory overhead (just think of all the references to observes the small suspects had to carry!) i also considered the mulitcast pattern, what basically means a message-based design. sounds like what i need, but one thing just seems "wrong" for both ways: how to track the events? say i got an object with 3 relevant values, whose changes yield to creating an event respectively notifying the observers. i had to implement this mechanism in every "Set()" method. for every new class i introduce. what sucks. it looks like lots of similar, redundant code and it's very prone to mistakes. how to get rid of this? i already thought of some kind of templatized GuardedOBject that implements the notification process. but this way, i could only guard predefined intefaces, for examlple only some "Set" method every object had to use (inluding exactly the same params) - not very good. maybe i missed sth, i've not been working with templates for too long... thoughts?