
This UML diagram has exactly one fault but I am not sure what it is.
My guess is that B cant be a part of A because its the superclass of C.
Anyone got a solution?

This UML diagram has exactly one fault but I am not sure what it is.
My guess is that B cant be a part of A because its the superclass of C.
Anyone got a solution?
If C is a specialisation of B, it inherits also it’s associations. This implies that any instance of C is a component of an instance of A in addition of being a component of an instance of D (because of the multiplicity of 1..1): this is in contradiction with UML composition which requires an exclusive ownership.
You may get a valid diagram for example by removing inheritance, by changing the multiplicity next to roleA to 0..1, or by using aggregation instead of composition on the side of A.
An element can only play the "part" role in one composition.
C has an inherited composition to A, and a composition to D
Both compositions are mandatory (multiplicity = 1) so a valid C cannot exist