in reply to Re: Re: Re: Object Terminology
in thread Object Terminology

Personally I do not feel as if i am framing this all in terms of inheritance. But i will concede that it reads that way to you and probably to others as well.

I tend to prefer multiple-inheritance with heavy Interface Polymorphism, as it makes the most sense to me. But i fully realize that this is not the most common approach.

All that said, I would appreciate some suggestions from you, or others in ways to improve my delegation section in particular, as well as other sections you feel may be lacking.

In response to your critiques:

The goal is not to mimic inheritance through delegation...
Personally I felt this line pointed not to how delgation is like inheritance, but instead I strove to draw a distinction between the two. Maybe a rewording is in order here.
Interfaces are not really inheritance per-say.
While Interfaces are not strictly an inheritance related concept, in OOP they are most commonly associated with some form of an inheritance mechanism. So drawing a relation between the two was not a bad thing IMO.
(Regarding Traits and Roles) To use our single inheritance model:
In this I was actually refering back to the Person-Employee-Manager example when i mentioned the "Single Inheritance model". My goal here was not to show a linkage between Traits and inheritance, as i feel traits are closer to delegation, but instead to show the idea of traits within a familiar (already used) context. Here a rewording is definitly in order.

Framing the entire discussion in terms of inheritance has the unfortunate tendency of emphasizing the second of my two questions above at the expense of the (more important) first question.
I disagree with you here, not that your first question (What can this object do?) is the most important, but that inheritance emphasizes code reuse rather than polymorphism. I think it is the common opinion of those who sway towards delegation that inheritance is more about code-reuse. This I beleive is more a limitation of the (more common) single inheritance model and of some of the more popular langauges (especially the more strongly types ones (C++, Java, etc.)). Multiple inheritance is alot about "What can this object do?", and when mixed with Interface Polymorphism, it becomes even more so. I actually tend to feel that multiple-inheritance is much more akin to the philosophy of delegation than it is the more abstract and heady single-inheritance school.

There too is a difference between building an set of inherited classes yourself (or in a team/company), and inheriting other peoples classes (or from outside of your team/company). My feeling on foreign objects (those written by others) is they should be handled with delegation, so as to minimize un-intended effects. Once properly wrapped, I may then choose to inherit my wrapper class later on. There are of course exceptions, but there are always exceptions.

But i digress, my goal was not to discuss OOP/OOA/OOD in this level of detail. But to instead try and simplify some relatively complex ideas into short paragraphs for easy consumption, in the hopes that a common understanding/terminology would promote discussion.

Your suggestions for edits and re-wording are extremely welcome.

-stvn

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Object Terminology
by duff (Parson) on Jan 12, 2004 at 03:36 UTC
    But i digress, my goal was not to discuss OOP/OOA/OOD in this level of detail. But to instead try and simplify some relatively complex ideas into short paragraphs for easy consumption, in the hopes that a common understanding/terminology would promote discussion

    I applaud your effort, but I think you slightly missed the mark of "easy consumption" :-). I tend to agree with chromatic that it looks like you're relating each concept to interitance. I wonder if it would be possible to describe each concept with out comparing or referencing the others. Or perhaps create a taxonomy (we are talking about OOP right? :-) of object composition, code reuse, etc. so that when you're talking about idea X, people know that it trys to accomplish the same goals as ideas Y and Z. (Perhaps taxonomy is a bad word because it will end up looking more like Venn diagrams)

      duff,

      I have been giving some thought as to categorizing each section, kind of like how "Design Patterns" are always formated with a consistent set of sections and sub sections. Is this what you mean when you talk about taxonomy?

      As for your note about "easy consumption", you are absolutely correct, I showed this to one of the interns we have at work, and he had to ask me alot of questions about various bits of terminology (encapsulation, polymorphism, etc). He is only a first year CS student and has had minimal OO experience, so he had seen the terms before, but was unclear on their meaning. So it seems that i may need to take a step back and define some of the other more fundemental elements of OO first, then move into the later topics.

      Thank you much for the comments. I will keep them all in mind. I think today is the day for me to write version 2.0, assuming those pesky paying clients don't bug me :-)

      -stvn