You can show Java™ attributes of collection type, such
as array lists, vectors, and so on, as association relationships to the collection
type in Unified Modeling Language (UML) class diagrams. It is also useful
to show the type of elements that the collection contains.
To show a Java attribute of collection type as an
association in a UML class diagram:
- In the diagram editor, right-click an attribute of collection type;
then click .
- In the Select Type window, from the Matching
type list, specify the type of elements that the collection contains
and click OK.
The attribute is removed from the classifier and displayed as an association
relationship along with the element type that the collection contains.
Note: The Select Type window opens only when
the element type that the collection contains is not defined.
Tip: You can also drag an attribute outside the classifier to show the
attribute as an association.