Aggregation is not same thing as generalization Aggregation relates instances.
Two distinct objects are involved, one of them is part of the other.
Generalization relates classes and is a way of structuring the description of a
single object. Both super-class and sub-class refers to properties of a single
object with generalization, an object is simultaneously an instances of the
super-class and an instances of sub-class. Confusion arises because both
aggregation and generalization give rise to trees through transitive closure.
An aggregation tree is composed of
object instances that are all part of a composite object a generalization tree
is composed of a classes that describes the object Aggregation is often called
“a-part of” relationship; generalization is often called “a-kind of” or “is-a”
relationship.
No comments:
Post a Comment