Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> Bill, > Why do you use the term composition, and not aggregation. It Both composition and aggregation are described in Ivar Jacobson's book "Object Oriented Software Engineering", section 3.2. He says that "Composition" is to "structure an object in parts" and uses the example of a person being made up of a head, body, arms etc. while in "Aggregation" there is an additional object called the aggregate object which "represents" the others. In this case he uses the example of a man, woman and child making up a family - there is an aggregate "family" object. I find this distinction rather subtle and not easy to follow. Why do we not have a separate "person" object? He also says in ch 5.4 that composition can be used "as an alternative to inheritance for reusing code" while in ch 7.3.1 an object which is "composed of" other objects is ... "sometimes called an aggregate"! <:�( Replies:
|
Sponsored Links
|