Associations are links that allow related objects
to communicate.
The product supports the following types of associations:
Bi-directional association where both objects
can send messages back and forth. This type of association is also
called a symmetric association. For more information,
see Creating bi-directional associations.
Directed association where only one of the
objects can send messages to the other. For more information, see Creating directed associations.
Composition aggregation defines a relationship
where one class fully contains the other. For more information, see Creating composition associations.
Creating bi-directional associations
Bi-directional associations (or symmetric
associations) are the simplest way that two classes can relate
to each other. A bi-directional association is shown as a line between
two classes, and can contain control points. The classes can be any
mix of classes, simple classes, or composite classes.
Creating directed associations
In a directed (or one-way) association,
only one of the objects can send messages to the other.
Creating aggregation associations
Associations and aggregation associations are similar in
usage. An association portrays a general relationship between two
classes; an aggregation association shows a whole-part relationship.
When you create an association or an aggregation association between
two classes and give it a role name that exists, you have created
another view of the existing association.
Creating composition associations
Another way of drawing a composite class is to use a composition
association. A composition association is a strong aggregation
relation connecting a composite class to a part class (component).
Associations in the browser
Associations are listed in the browser under the category Association
Ends under the owning class. The browser display contains
separate icons for each association type.
Associations implementation IBM® Rational® Rhapsody® implements
associations using containers. Containers are objects
that store collections of other objects. To properly generate code
for associations, you must specify the container set and type within
that set you are using for the association.
Select associations
In object model diagrams, you can select associations for
classes that have more than one association defined between the same
two classes. To do this, right-click an association line and then
select Select Association.