Issues about delegation
mike_ekim at yahoo.com
Thu Nov 6 03:34:23 UTC 2003
--- In self-interest at yahoogroups.com, "J. Baltasar García Perez-
Schofield" <jgarcia at e...> wrote:
> These two objects, joe2, and mary2, share the shame
> String, because both objects have a "parent" attribute pointing to
> Person. Worst of all, joe2 and mary2 are actually modifying a
> prototype (an object which is playing the role, in this case, of a
> How can I solve this ?
I think the most simple solution is to use create-on-assign, where a
slot is created in the 'instance' only when you assign a value. This
saves space and also is a more generic solution.
I have a test runtime system right now that works well like this,
although I haven't tested large programs. I'm trying to avoid using
things such as traits to keep it simple. mybutton is-a Button is-a
View is-a Object. Each 'instance' is simply a specialization. I
don't know if this will work in the end, but it's what I'm going for.
More information about the Self-interest