[self-interest] Issues about delegation
"J. Baltasar García Perez-Schofield"
jgarcia at ei.uvigo.es
Wed Nov 5 19:45:10 UTC 2003
Dear Jecel (though anyone is invited to join the discussion):
> > I see. So, the "general" solution would be to copy all
> > inherited attributes.
>
>Actually, in that kind of system you don't copy anything until someone
>tries to change it. So the "instances" might end up all looking
>different from each other depending on their history.
Yeah, but I mean, if you don't have copy-on-write slots, then you
should copy all data slots (attributes) of prototype object X in prototype
object X' when you create it, deriving from X.
That raises another issue: dynamic inheritance. You should copy
all atributes of the parent prototype object each time the 'parent' slot
changed ...
It seems that the issue of attributes complicates the
inheritance-using-delegation approach.
Salud !
j.Baltasar
> > I understand. Is 'traits' a way to distinguish between
> > prototype objects ("classes") and "instance" objects ?
>
>It is a separate namespace - you can have both 'traits person' and
>'prototype person' in the system, but since 'prototype*' is a parent
>object in the 'lobby' object you can just say 'person' in the second
>case.
>
>The "traits" are more like the classes while the prototypes are more
>like instances. The objects you clone from them look exactly like them
>(since we don't have the "copy-on-write" slots mentioned above). In
>fact, a prototype should be a fully functional "instance" which is why
>I decided to give it a name like 'John Doe' instead of ''. Prototypes
>are special in some languages, but not in Self.
>
>-- Jecel
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
=======================================
PBC - J. Baltasar García Perez-Schofield
Dep. Informática, Universidad de Vigo, España (Spain)
More information about the Self-interest
mailing list