Search



Advanced

Class Diagram Notations

Associations

< Previous (Attributes/Services)

(Inheritance) Next >

Home / Class Diagrams / Class Diagram Notations / Associations

An association is represented as a solid line between two classes. In this sample, Class1 has a public association, named Association1, with Class2. Class1 will have Association1 as its attribute.
 



If the association has get methods (with return type) and/or set methods (with parameters), then the association will be represented as a solid line and a dashed line between two classes.
 



You can change the association line end symbols by selecting View | Symbols when you right mouse click a line.  The choices are a solid line, a solid line with a hollow “diamond” (aggregation), or a solid line with a filled “diamond” (composition). See the lines below. However, you would not use both at the same time.

 

If you are new to UML don’t get hung up on this distinction. Many experienced people argue about it on newsgroups