Association relationships in C/C++ domain modeling class diagrams

In C/C++ domain modeling 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 consumer 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 Customer class has a single association (1) to an Account class, indicating that each Account instance is owned by one Customer instance. If you have an account, you can locate the owning customer of that account, and for a given customer, you can find the account of that customer. The association between the Customer 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 class diagrams, association relationships in a C/C++ application represent the following things:

In visualization mapping, instance variables in a C/C++ application become attributes in classifiers in class diagrams. By default, all C/C++ fields are shown as attributes.

An association relationship connector appears as a solid line between two classifiers.

The following illustration displays a source code example and a graphical representation of an Association Relationship.

C/C++ source code UML visualization
This snapshot shows C/C++ source code for association relationships. A C/C++ association relationship is displayed.

Feedback