i came across this definition
Aggregation has two properties:
antisymmetry,
transitivity
What does it mean?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Aggregation is a type of object composition where object thing is part of another object. This is contrasted with ownership, where one object owns the other.
For example, a car is made out of many parts – engine, wheels, etc. The parts are aggregated into the car object.
But, in another example (which I found online) if a Person object has a car, that is not aggregation. The person owns it, but the car is not part of the person.
An important consequence of this difference is that when an object is destroyed, its aggregated parts should be destroyed as well. But objects that it owns, which are not part of it, should remain intact.
So, to the definitions:
Antisymmetry – I couldn’t find an exact definition, but my intuition tells me that this means that two objects cannot be part of each other. Object A aggregates B, but never vice versa at the same time (unless A and B are equal, which is more about set theory than OOP). My arm is part of me, but I cannot be part of my arm.
Transitivity – It’s just like transitivity in math. if A is part of B, and B is part of C, then A must be part of C. My hand is part of my arm, my arm is part of me, therefore my hand is part of me.