You can show Java attributes
of collection type, such as array lists, vectors, and so on, as association
relationships to the collection type in domain modeling class diagrams.
It is also useful to show the type of elements that the collection
contains.
Before you begin
You must have a class diagram open.
About this task
To show a Java attribute of collection type
as an association in a domain modeling class diagram, complete the
following steps:
Procedure
- 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.
Results
The attribute is removed from the classifier and displayed
as an association relationship along with the element type that the
collection contains.
What to do next
Note: The Select Type window opens only
when the field does not already have a collection content type specified.
In Java 5, collection content types are already specified, hence you
no longer see the Select Type window.
Tip: You can also drag an attribute outside the classifier to
show the attribute as an association.