Solved

difference between class inheritance and composition

Posted on 1998-11-19
2
1,138 Views
Last Modified: 2008-02-20
what is the different between class Inheritance and composistion ? and When would I choose the former over the later ?
0
Comment
Question by:anhben
2 Comments
 
LVL 5

Expert Comment

by:msmolyak
ID: 1227860
The following book has an entire chapter (very well written too) dedicated to this subject:

Java Design : Building Better Apps and Applets (Yourdon Press Computing Series), 1st Edition by Peter Coad, Mark Mayfield, Pete Coad

It gives you the rules on when to use inheritance and when to use composition instead.
0
 
LVL 5

Accepted Solution

by:
fontaine earned 50 total points
ID: 1227861
In the November issue of the Javaworld on-line magazine, there is a 2500 words article
entitled...

"Inheritance versus composition: Which one should you choose? "

This is exacly what you need! Here is the URL:

http://www.javaworld.com/javaworld/jw-11-1998/jw-11-techniques.html
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java - sorting a list of objects where the properties of the objects can change during the sort 7 51
servlet  URL Rewriting 1 36
oracle 11g 23 78
by zero exception 10 39
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question