Conception of inheritance in object-oriented languages

I was discussing multiple inheritance vs. single inheritance with a friend of mine, and discovered that plainly, my conception of Object-Oriented design is completely different than his. I am mostly an Obj-C programmer, so Multiple Inheritance is not something I use daily. He is mostly a C++ programmer under Windows/PSP, so we probably use different concepts on a day-to-day basis.

He actually brought the following subject : What does a new human being inherit from?

My conception of that was that there would be a Human class, and the new being would inherit from that class and get some instance variables (such as his DNA and others) from his two parents.

His conception was that the child would inherit from his two parents, in order to get the methods of his parents.

And now I'm kind of confused, because honestly... Inheriting from objects? Isn't inheritance used to inherit from classes which contain methods common to a certain group of objects? This argument really confused me to no end.

Answers


The parents are also humans, which are part of the family of creatures called mammals. Your thoughts seem most logical to me.

public class Human extends Mammal implements HunterGatherer, Speech, CognitiveThought {

    public Human(Human mother, Human father) {
        super(mother, father);
        // ...
    }

    // ...
}

Certainly I can't see:

public class Human extends Mother, Father { ... }

I see the mother and father as being rather involved in the construction of their child, all three are humans.


To take the analogy head-on, the new human gets its traits from a pair of zygotes generated by the parents, which are only loosely based on the parents' own DNA.

Realistically, I think this is just a bad analogy. Just because "inheritance" is a borrowed term from genetics (or wills and contract law?) doesn't mean it has to conceptually match 1:1 with software development, and in fact they are only superficially similar concepts.

For example, my father is a lawyer, and my mother is a school teacher. I was not born with the skills (behaviours, methods...) of either one.


Need Your Help

Combining DROP USER and DROP DATABASE with SELECT .. WHERE query?

mysql sql bash

I'd like to make a very simple thing, replicate the functionality of mysql's interactive mysql_secure_installation script. My question is that is there a simple, built-in way in MySQL to combine the

SQLiteOpenHelper onCreate running twice?

android sqlite sqliteopenhelper

In my database handler class (extends SQLiteOpenHelper) I have the onCreate() Method:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.