Tell me, please, what is the difference between black and white rhombuses while inheriting a class in the UML charts?
Answer 1, Authority 100%
Increased rhombus – the ratio of aggregation. Aggregation is a whole part ratio.
- Aggregate (
MyEntyClass) can exist as independently of parts (
MyClass), and with them;
- parts may exist independently of the unit
- Aggregate is in a sense incomplete in the absence of parts
- parts can belong to several units
Flavored rhombus composition. The composition is a strict form of aggregation.
- at the same time part (
myclass2) can belong only to one composite (
MyEntyClass) – Unable to own parties.
- composite has an exceptional responsibility for all its parts; This means that he is responsible for their creation and destruction
- Composite can release parts by passing responsibility for them to another object
- In the case of the destruction of the composite, he must destroy all its parts or transfer responsibility for them to another object.
The key difference between the composition and aggregation is that in the compositions in parts there are no independent life beyond the whole (composite), moreover, each part belongs to a maximum of one and only one whole (composite), whereas with aggregation part can be shared in several integers (aggregates).
d. Arlow, A. Neesteadt – “UML2 and a unified process”