Association is a link or dependency between two or more classes. Association class is a class which provides an additional information about the relationship. An association class is different to other and may has class-like properties, such as attributes, operations and other associations. These are often occur in many-to-many and many-to-one associations.
For example, a ‘Student’ class has an association with class called ‘Course’, which represents an educational course. The student class can enroll in a class. ‘Enrollment’ is an association class, which represents the relationship between student and course classes by providing class-like properties like, section, grade, and semester information related to association relationship between two classes. In this scenario, Student can register into many courses and each course class has many students. Thus, it is many-to-many relationship.
Let’s take another example, a ‘Person’ has an association relationship with ‘Company’ class. Here, person works for company. So, an association class called ‘Employment’ gives the detailed about relationship between person class and company class by providing data as an attributes like Salary, start-Date, designation etc., In this scenario, person can work for only one company at a time and many persons could work for same company. Thus, it is many-to-one relationship.