Association, aggregation and composition concepts
An association is the semantic relationship between two or more classifiers
that involves connections among their instances.
An aggregation is a special form of association that specifies a whole-part
relationship between the aggregate (whole) and a component part.
A composition is a form of aggregation with strong ownership and coincident
lifetime as part of the whole. Parts with non-fixed multiplicity may be created after
the composite itself, but once created, they live and die with it (i.e. they share life-times).
Such parts can also be explicitly removed before the death of the composite.
Composition may be recursive.
Common properties
- Name: write the Java class name.
- Alias: identify the concept other than by its name (optional).
- UML Stereotype: you can assign a UML Stereotype to those concepts.
- Description: enter a textual description.
Association End Properties
When right-clicking an association end, you will find the following properties under
the design tab of the properties window.
- Field: corresponding association field.
- Multiplicity: sets the association end’s multiplicity.
- Navigable: sets the association end as navigable. Will remove, though not delete, the corresponding association field.
- Aggregation: sets the category to association, aggregation or composition.
- Ordered: sets the association end’s multiplicity “many/one or more” as an ordered collection. Provided only for documentation purposes.
Association Concepts
When an association is created, it will automatically create two association ends
(roles) and their corresponding fields in each classes.
Actions
- Delete: delete the association, including dependent association ends and
association fields.
- Delete (preserve fields): delete the association, including dependent association
ends only. The association fields will be kept preserved.
- Delete graphic representation: delete the association’s graphical
represention only. Use the Create Association action on the remaining association
fields to recreate the association’s graphical representation.
- Collection data type: set the type of the many association field to the collection
type and the element type to the corresponding class.
- Create association : create the association in the diagram.