Association Role are used to indicate the role played by the classes in the association.

This association represents a marriage between a Man
object and a Woman
object. The respective roles played by objects of these two classes are husband
and wife
.

Note how the variable names match closely with the association roles.
class Man {
Woman wife;
}
class Woman {
Man husband;
}
class Man:
def __init__(self):
self.wife = None # a Woman object
class Woman:
def __init__(self):
self.husband = None # a Man object
The role of Student
objects in this association is charges
(i.e. Admin is in charge of students)

class Admin {
List<Student> charges;
}
class Admin:
def __init__(self):
self.charges = [] # list of Student objects
Association roles are optional to show. They are particularly useful for differentiating among multiple associations between the same two classes.
In each the three associations between the Flight
class and the Airport
class given below, the Airport
class plays a different role.
