Is any of this seriously debated? I mean, traits notwithstanding, has anyone who has ever built a large hierarchy of objects NOT run into the above problems?
Traits are not required to avoid bloat or duplication that comes with inheritance, just use composition. Granted, it requires explicit delegation (or a DNU hack) but, many times, only a small portion of the behavior of the provided by the Collection (or whatever) is needed. This, in fact, can help understand a system better because the only "inherited" behavior is explicitly declared by the fowarding messages.
I'm not at all opposed to Traits in the image, especially if it is not disruptive to function or performance. I'm sure I'll even find a good use for it some day..
- Chris
On Wed, 31 Aug 2005 08:39:36 -0700, Chris Muller afunkyobject@yahoo.com wrote:
Is any of this seriously debated? I mean, traits notwithstanding, has anyone who has ever built a large hierarchy of objects NOT run into the above problems?
Traits are not required to avoid bloat or duplication that comes with inheritance, just use composition. Granted, it requires explicit delegation (or a DNU hack) but, many times, only a small portion of the behavior of the provided by the Collection (or whatever) is needed. This, in fact, can help understand a system better because the only "inherited" behavior is explicitly declared by the fowarding messages.
As a longtime Delphi user, I'm quite aware of the value (and shortcomings) of delegation.
I'm not at all opposed to Traits in the image, especially if it is not disruptive to function or performance. I'm sure I'll even find a good use for it some day..
I think it's amazing what they've done as far as making it non-disruptive. (And I'm intrigued by the question of "is inheritance necessary".)
Blake> I'm intrigued by the question of "is inheritance necessary"
Perhaps a better question would be "Is inheritance optimal?" Or even better: "When is inheritance optimal, and when is it not? And when it isn't, what alternatives are better?"
--Alan
squeak-dev@lists.squeakfoundation.org