UML Modeling Techniques > Class modeling > Creating class modeling items > Creating an association
  
Creating an association
You can create an Association through a Class Diagram or Composite Structure Diagram. Use a Composite Structure Diagram to create an Association that involves Parts or Ports.
For information about showing an Association between Activities and Classes (the Association symbol represents an object node) see, Showing an association between an activity and a class on a class diagram
To create an association on a class diagram:
1. On the Class Diagram toolbar, click the Association or Uni-directional Association button as appropriate.
2. On the diagram, click the source item.
The source item can be an Actor, Class, Data Type, Interface or Signal.
3. On the diagram, click the destination item.
The destination item can be an Actor, Class, Data Type, Interface or Signal.
4. Type the name of the Association, and then press the Enter key.
To create an association on a composite structure diagram:
1. On the Composite Structure Diagram toolbar, click the appropriate Association button:
Shallow Association
Deep Association
Shallow Unidirectional Association
Deep Unidirectional Association
For information about shallow and deep Associations, see, Shallow and deep associations
2. On the diagram, click the source item.
The source item can be an Actor, Class, Data Type, Interface, Signal, Part or Port.
3. On the diagram, click the destination item.
The destination item can be an Actor, Class, Data Type, Interface, Signal, Part or Port.
To create an association and ports in one operation:
1. On a Composite Structure Diagram , ensure that the items you want to connect are shown.
2. On the Structure Diagram toolbar, click the Complete Association button.
3. Click the source Class, Part or Port.
4. Click the destination Class, Part or Port.
5. If the Select Object dialog is displayed, create or select the type of the Ports that will be created, or click Untyped to create untyped Ports, and then click OK.
Note that if you create a complete association between a Port and a Class or Part, the new Port will use the same type as the connected Port.