s3a
May 28th, 2010, 10:57 PM
Is composition the action of referring to objects of other classes and treating them as members of a particular other class? (In Java if this definition is not universal to all languages)
This is all due to my attempt to understand the differences between aggregation, composition and inheritance. Also, by the way, is inheritance extending an abstract class or interface? As for aggregation, I'm not too sure as to what it is other than it being slightly related to composition in that they both have a "has-a" relationship as opposed to the is "is-a" relationship that inheritance has.
If I'm right, it'd be great to have a confirmation on the stuff I stated otherwise, I'd appreciate it if someone could inform me of what the proper definitions are.
Any input would be greatly appreciated!
Thanks in advance!
This is all due to my attempt to understand the differences between aggregation, composition and inheritance. Also, by the way, is inheritance extending an abstract class or interface? As for aggregation, I'm not too sure as to what it is other than it being slightly related to composition in that they both have a "has-a" relationship as opposed to the is "is-a" relationship that inheritance has.
If I'm right, it'd be great to have a confirmation on the stuff I stated otherwise, I'd appreciate it if someone could inform me of what the proper definitions are.
Any input would be greatly appreciated!
Thanks in advance!