I have a framework which supports LOTS of objects (91 million once). One way to reduce the size of the objects is to have TWO objects with variables:
- The per-instance variables that change amongst objects: x, y for example.
- A “static” set of variables that are shared by all objects. Color sometimes is shared, Shape often, TextColor almost always .. and so-on
I can reasonably build this with proto techniques: have the static object “shimmed” just under the instance vars.
It seems a bit odd tho and I wonder if this has come up with StampIt style programming? The advantages of the statics is that if you look for a variable not in the top level, instance variable object, it will be found in the second level, static/default level.