How to show abstract class containing other classes in Java UML class diagrams?

Viewed 113

Looking for clarification on how to draw the arrows for an abstract class which contains private variables of a different class type (i.e. non-primitive variables). I've got this as an example and was not sure if correct.

Image: Example I made here

Is this correct?

1 Answers

Rather than Realization which is meant more for interface realization you should use simple Generalization with a solid line instead. This is about inheritance where the concrete inherit from the abstract classes. This means also that the association is inherited which for a realization would not be the case.

Since Christophe mentioned it: There is no need to repeat operations/attributes in the inheriting class. See pp. 100 of UML 2.5:

Members that are inherited by a Classifier may be shown on a diagram of that Classifier by prepending a caret ’^’ symbol to the textual representation that would be shown if the member were not inherited. [...] Inherited members may also be shown in a lighter color to help distinguish them from non-inherited members. A conforming implementation does not need to provide this option.

Related