Association relationships
In Unified Modeling Language (UML) visualization class diagrams, an association is a structural relationship that indicates that objects of one classifier (such as a class and interface) are connected and can navigate to objects of another classifier.
An association connects two classifiers: the supplier classifier and the client classifier. Associations can help you make design decisions about the structure of your data. You can make decisions about not only the classes that are needed to contain the data, but also about which classes are needed to share the data with other classes. An association supports data sharing between classes or, in the case of a self-association, between objects of the same class.
For example, a Client class may have a single association (1) to an Account class, which indicates that each Account instance is owned by one Client instance. If you have an Account, you can locate the owning Client of that account. And with a given Client, you can find the Account of that client. The association between the Client class and the Account class is important because it shows the structure between the two classifiers.
Multiplicity information can be linked to an association to show how many instances of class A are linked with instances of class B. Multiplicity information can be linked to both ends of association relationships.
In UML class diagrams, association relationships in a Java application represent the following things:
- A semantic relationship between two or more classes that specifies connections between their instances
- A structural relationship that specifies that objects of one class are connected to objects of a second (possibly the same) class
In UML visualization mapping, instance variables in a Java application become attributes in classifier shapes in UML class diagrams. By default, all Java and container-managed persistence (CMP) entity bean fields are shown as attributes.
An association relationship connector appears as a solid line between two classifiers.
Java source code UML visualization
![]()
![]()
Parent topic
Relationships
Related concepts
Dependency relationships
Extends relationships
Implements relationships
Owned element association relationships
Related tasks
Showing related Java elements
Showing related Java elements based on outgoing relationships
Showing related Java elements based on incoming relationships
Showing associations as attributes
Showing attributes as associations