What is Association
Association is a (*a*) relationship between two classes. It allows one object instance to cause another to perform an action on its behalf. Association is the more general term that define the relationship between two classes, where as the aggregation and composition are relatively special.
In this case we can say that there is an association betweenStudentRegistrar
andRecordManager
or there is a directional association fromStudentRegistrar
toRecordManager
orStudentRegistrar
use a (*Use*)RecordManager
. Since a direction is explicitly specified, in this case the controller class is theStudentRegistrar
.
To some beginners, association is a confusing concept. The troubles created not only by the association alone, but with two other_OOP_concepts, that is association, aggregation and composition. Every one understands association, before aggregation and composition are described. Aggregation or composition cannot be separately understood. If you understand aggregation alone it will crack the definition given for association, and if you try to understand composition alone it will always threaten the definition given for aggregation, all three concepts are closely related, hence must be studed together, by comparing one definition to another. Let’s explore all three and see whether we can understand the differences between these useful concepts.