Association
Last updated
Last updated
An Association in a Class Diagram represents a relationship between two classes. It indicates that objects of one class are connected to objects of another class, or that one class uses services of another class.
With Associations in Modedraw's Class Diagram, you can:
Show relationships between classes in your system
Indicate how classes interact or depend on each other
Specify the multiplicity of relationships between classes
Represent bi-directional or unidirectional relationships
Add role names to clarify the nature of the association
Model various types of relationships such as "has-a" or "uses"
An Association in Modedraw's Class Diagram tool is typically represented by a solid line connecting two classes. Key points to understand about Associations include:
Multiplicity: You can specify how many objects of each class participate in the relationship.
Direction: Associations can be bi-directional (default) or unidirectional.
Role names: You can add names to each end of the association to clarify the role of each class in the relationship.
Attributes: Associations can have their own attributes if the relationship itself needs to store data.
To create an Association in Modedraw's Class Diagram:
Select the Association tool from the toolbox.
Click on the first class you want to connect.
Move your mouse to the second class you want to connect.
Click on the second class. An Association line will appear connecting the two classes.
To create an Association in Modedraw's Class Diagram:
Select the Association tool from the toolbox.
Click on a class you want to create the self-link for.
Click again on the same class. A self-link will appear.
Associations can be bi-directional or unidirectional. To adjust navigability, open the properties dialog and toggle the Navigable checkbox for both ends of the relationship.