StudentMusicianto inherit from a class named
Person, a class named
Musician, and a class named
Worker. This can be abbreviated
StudentMusician : Person, Musician, Worker.
Ambiguities arise in multiple inheritance, as in the example above, if for instance the class Musician inherited from Person and Worker and the class Worker inherited from Person. There would then be the following rules:
StudentMusician: Person, Musician, Worker
Musician : Person, Worker
If a compiler is looking at the class StudentMusician it needs to know whether it should join identical features together, or whether they should be separate features. For instance, it would make sense to join the "Age" features of Person together for StudentMusician. A person's age doesn't change if you consider them a Person, a Worker, or a Musician. It would, however, make sense to separate the feature "Name" in Person and Musician if they use a different stage name than their given name. The options of joining and separating are both valid in their own context and only the programmer knows which option is correct for the class they are designing.
Languages have different ways of dealing with these problems of repeated inheritance.
Java, Nemerle, C#, PHP, and Objective-C do not allow multiple inheritance, and this avoids any ambiguity. However, these four languages allow classes to inherit from multiple interfaces, recreating some of the problems mentioned.
Multiple inheritance in languages with C++/Java style constructors exacerbates the inheritance problem of constructors and constructor chaining, thereby creating maintenance and extensibility problems in these languages. Objects in inheritance relationships with greatly varying construction methods are hard to implement under the constructor chaining paradigm.
US Patent Issued to Oracle America on April 12 for "Dynamic Multiple Inheritance Method Dispatch Data Structure Including an M-Table Size, I-Table Containing One Or More Holder Addressor Regions and Type Extension Testing by Frugal Perfect Hashing" (American, French Inventors)
Apr 19, 2011; ALEXANDRIA, Va., April 19 -- United States Patent no. 7,925,640, issued on April 12, was assigned to Oracle America Inc. (Redwood...
Research on Computer Programming Reported by Investigators at Korea Advanced Institute of Science and Technology (KAIST).
Feb 23, 2012; "In previous work, we presented rules for defining overloaded functions that ensure type safety under symmetric multiple dispatch...