IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Inheritance is a tool.
Just like anything else. Use it where it makes sense. I am automatically skeptical of positions that say "always" or "never" use X, Y, or Z.

Inheritance is over-used by naive practitioners. That doesn't mean it shouldn't be used at all. I'm reminded of the single vs. multi-inheritance arguments. While the 'single only' people have a point with their complaints about multi-inheritance, there have been times I wish I'd had some sort of mix-in capability in a single-inheritance language.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Re: Inheritance is a tool.
At one time, wasn't OOP "defined" by properties such as inheritance? (Never did grok that as essential..)
-drl
New There's more to life than implementation inheritance.
Which is what most people think when they say "inheritance".

There's also interface inheritance. Delegation is yet another different thing that uses prototyping and on-the-fly "inheritance" graphs. Inheritance is really just one-way static delegation (and I won't get into categories here :-).

But to answer your question, most OO definitions include inheritance. Languages without inheritance are often called "object-based". Read 1.15, 1.4, and 1.7 [link|http://www.cyberdyne-object-sys.com/oofaq2/|here] for more.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Definitions
From page 38 in the second edition of Object-Oriented Analysis and Design by Booch:
Cardelli and Wegner thus say "that a language is object-oriented if and only if it satisfies the following requirements:

  • it supports objects that are data abstractions with an interface of named operations and hidden local state

  • objects have an associated type

  • Types [classes] may inherit attributes from supertypes [superclasses]"


  • ...

    If a language does not provide direct support for inheritance, then it is not object-oriented. Cardelli and Wagner distinguish such languages by calling them object based

    New I'd ask Alan Kay
    its his term.

    Quote: "I made up the term 'object-oriented', and I can tell you I didn't have C++ in mind" - Alan Kay, OOPSLA '97

    He'd say it needs garbage collection.

    He'd also add it should be more message oriented than function calling oriented. (See thread from last week or so).

    Or read his paper on the OpenCroquet site (opencroquet.org).



    Smalltalk is dangerous. It is a drug. My advice to you would be don't try it; it could ruin your life. Once you take the time to learn it (to REALLY learn it) you will see that there is nothing out there (yet) to touch it. Of course, like all drugs, how dangerous it is depends on your character. It may be that once you've got to this stage you'll find it difficult (if not impossible) to "go back" to other languages and, if you are forced to, you might become an embittered character constantly muttering ascerbic comments under your breath. Who knows, you may even have to quit the software industry altogether because nothing else lives up to your new expectations.
    --AndyBower
    Expand Edited by tuberculosis Aug. 21, 2007, 06:34:14 AM EDT
    New Thank you, Scott!
    Just like anything else. Use it where it makes sense. I am automatically skeptical of positions that say "always" or "never" use X, Y, or Z.


    Words of wisdom that the "purists" will never quite 'get'.
    jb4
    Boy I'd like to see those words on a PR banner behind [Treasury Secretary John] Snow at the podium:
    Jobs and Growth: Just Wait.

    John J. Andrew, unemployed programmer; see jobforjohn.com
    New Another Me Too
    Inheritance is a tool, delegation is a tool. Both have some sort of coupling to other code. Understand the coupling and use the tools appropriately.
    --
    -- Jim Weirich jweirich@one.net [link|http://onestepback.org|http://onestepback.org]
    ---------------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
    New Good example of bad inheritance, java.util.Stack
    Stack inherits from Vector. The problem is that this means that Stack inherits all of Vector's public methods like insertElementAt(int), removeElementAt(int) etc. meaning that anyone can destroy your stack by using these public methods. Delegation was clearly called for here, where Stack would inherit from Object and internally use a Vector.

    A good example of inheritance in Java is LinkedHashMap (I just happened to read up on it so it is in my head) which extends HashMap. LinkedHashMap is an extension of a HashMap where it maintains a list of keys allowing the keys to be retrieved in the order that they were added. A LinkedHashMap is clearly a HashMap+ a little extra functionality and therefore it makes sense to reuse the existing HashMap implementation while extending it.
         Why extends is evil? - (johnu) - (44)
             Is this just for Java? - (drewk)
             This argument is needlessly pedantic, IMO - (FuManChu)
             Lesson learned from Smalltalk - (ChrisR) - (1)
                 sounds like a will -NT - (deSitter)
             Inheritance is a tool. - (admin) - (7)
                 Re: Inheritance is a tool. - (deSitter) - (3)
                     There's more to life than implementation inheritance. - (admin)
                     Definitions - (johnu) - (1)
                         I'd ask Alan Kay - (tuberculosis)
                 Thank you, Scott! - (jb4) - (1)
                     Another Me Too - (JimWeirich)
                 Good example of bad inheritance, java.util.Stack - (bluke)
             This guy cracks me up - (tuberculosis)
             IS A vs HAS A - (gdaustin) - (30)
                 Quite. - (static)
                 I missed that course - (drewk) - (18)
                     Shorthand for relationships - (admin) - (17)
                         Re: Shorthand for relationships - (deSitter) - (1)
                             snicker - (FuManChu)
                         ISA/HASA are good for a first approximation - (JimWeirich) - (14)
                             So what does it get you? - (drewk) - (10)
                                 Specialization vs. Generalization - (gdaustin)
                                 Code - (JimWeirich) - (7)
                                     Thanks, but what would HASA look like? -NT - (drewk) - (6)
                                         HASA - (gdaustin) - (5)
                                             See, that's where I always get tripped up - (drewk) - (4)
                                                 There is a point to naming the useless stuff - (ben_tilly) - (3)
                                                     Clarification - (drewk) - (2)
                                                         Yes - (ben_tilly) - (1)
                                                             That's why I shouldn't be a teacher - (drewk)
                                 The example of a stack (see post above) is a good one - (bluke)
                             My car is a Saturn - (gdaustin)
                             hierarchies and the real world - (tablizer) - (1)
                                 Nonsense - (ChrisR)
                 Not quite that simple - (tuberculosis) - (9)
                     Thing I love/hate about smalltalk - (drewk) - (2)
                         Similar to Python in that fashion -NT - (admin)
                         Its real -NT - (tuberculosis)
                     Forgot to mention: key driver is "substitutability" - (tuberculosis) - (4)
                         Techies at Hertz - (tablizer) - (3)
                             And if your Table or Data Structure is... - (ChrisR)
                             Mostly - (tuberculosis) - (1)
                                 Or perhaps that .... - (gdaustin)
                     Code sharing vs. polymorphism - (johnu)

    Cue the Twilight Zone Music, will ya?
    207 ms