Difference between aggregation and composition
Aggregation Vs composition:
Aggregation and composition are both words that relate to a sense of ownership. Because of this common factor, some may be downright baffled by the difference between these words whereas for some, the definition of these two words may be crystal clear. Therefore, the target of this article is to provide a comprehensive account of what aggregation and composition stand for and also to shed some light on the many differences that these two terms share.
What is aggregation?
The term aggregation is used to indicate ownership or a whole/part relationship. This word is used with regards to special cases of association where a directional association between objects is indicated. An aggregation indicates a weak-coupled relationship between two entities where one entity could be part of the other, but either party is capable of existing independently without the other. In aggregation, the object exists outside the other and is thus created outside. For example, one can point out the relationship between a school and a teacher. The school can exist without the teacher and the teacher can exist without the school as well.
What is composition?
Composition is a form of relationship that is different from others. It can be stated as a strong-coupled relationship between two entities where one entity is a part of the other and both are in need of each other for their existence. In the case of composition, the object only exists or only makes sense inside the other, as a part of the other. For example, one can take the relationship between a human being and his heart. The human being cannot exist without his heart and the heart does not function without the human being either.
What is the difference between composition and aggregation?
While both aggregation and composition refers to types of bonds and relationships, the kind of relationships or bonds indicated by the two words are quite different from one another. Aggregation refers to a weak type of bond where one object is created outside the other and has no strong, unbreakable relation to it. For example, one can indicate the relationship between a man and his car. And yet, composition refers to a strong relationship between two or more entities where one part is created within the other and they are almost inseparable. Therefore, while composition stands for a strong type of bond, the type of bond indicated by aggregation is relatively weak.
In the case of aggregation, the entities within that relationship can very well exist without each other. As the objects exist outside of each other, they are not interdependent on one another. For example, one can indicate the relationship between a doctor and a hospital. However in the case of a composition, as the objects within the bond are dependant on each other, one object either cannot exist without the other or does not make any sense without the other. The best example for this sort of relationship would be a human being and his heart. Obviously, these two entities, if taken separately cannot exist without one another and does not make any sense independently either.
Tags: aggregate, aggregation, assembly, association, collection, company, congregation, convergence, crowd, ensemble, entirety, gross, group, integer, jackpot, lock stock and barrel, mass, quantity, sum, sum total, throng, total, unit, utmost, wall to wall, whole ball of wax, whole enchilada
Other differences in category: