Multiple Inheritance Examples
Java Multiple Inheritance Rant
I know, I know, it’s a tired old subject. But when you’ve got to work with a crippled language like Java, sometimes tired old subjects rear their ugly heads again, and you need to rant a little.
Here’s a very simple, very concrete example of why Java’s policy not to include multiple inheritance in the language sucks donkey balls, and the “we use interfaces instead of multiple inheritance” excuse shows how lame it is:
- You’re using a framework1 that defines a class A and a class B derived from A.
- You’re using both A and B in your project. The framework forces you to subclass either class in order to use it. Let’s call those derivates A’ and B’, because I quite like that notation.
- You need to extend the functionality of A in your project for all derivates of the class.
In Java, you’re forced to put this functionality into both A’ and B’, even though duplicate code is a code smell.
Oh, sure, you can factor the functionality out into a class C that you use in A’ and B’ in an identical manner, but that doesn’t really avoid duplicate code, it just reduces it. And your class C is guaranteed to have an ugly interface. And it’ll be a real hoot accessing members of the classes you’re extending without making all sorts of shit public. Or, worse still, adding more layers of indirection.
Fuck you, Java.
- Aren’t you always using frameworks in Java? [↩]
Popular Search Questions
- difference between group and panel interview
- cache coherence interview questions
- What would you consider as your biggest achievement and why?
- Is sorter an active or passive transformation? When do we consider it to be active and passive?
- select * from
- what is the difference between datastage and informatica
- nxnnn
- race around condition
- net c# interview questions with answers What is Manifest
- Is sorter an active or passive transformation? When do we consider it to be active and passive
Recent Comments
- uzma on I want to prepare a questionnaire. The details about it are as follows: – 1. Identify a large company/organization that is a prime candidate for DWH project. (For example Telecommunication, an insurance company, banks, may be the prime candidate for this) 2. Give at least four reasons for the selecting the organization. 3. Prepare a questionnaire consisting of at least 15 non-trivial questions to collect requirements/information about the organization. This information is required to build data warehouse. Can you please tell me what should be those 15 questions to ask from a company, say a telecom company?
- IT support London on How to install SQL Server 2005 Express Edition?
- shivesh soni on Which name space is used by ADO.NET
- Fahim Kanji on What is the Dot Net Framework data provider for Oracle?
- azeed on What is the exact difference betwwen Join,Merge and Lookup Stage??
Tags
- Inheritance Search
Inheritance is the practice of passing on property, titles, debts, rights and obligations upon the death of an individual. It has long played an important role in human ...
- The Inheritance Louisa May Alcott
Amazon.com: The Inheritance (Penguin Classics) (9780140436662): Louisa May Alcott, Joel Myerson, Daniel Shealy: Books
- Tax On Inheritances
The federal inheritance tax laws are some of the most complicated in the tax code. When an individual passes on, the federal government imposes an estate tax. This tax ...
- Us Inheritance Law
inheritance, in law inheritance, in law: see heir heir, person designated by law to succeed to the ownership of property of another if that owner does not make a ...
- Multiple Inheritance Examples
Besides textbook examples -- in the real world -- does it ever make sense to use multiple inheritance (where more than one of the base classes are not pure interfaces) in ...




