Association is a relation between two separate classes which establishes through their objects. Association can be one-to-one, one-to-many, many-to-one, and many-to-many. In OOP, an object communicates to other objects to use functionality and services provided by that object. |
Composition and aggregation are the two forms of association.
In the example below, two separate classes Bank and Employee are associated through their objects.
Bank can have many employees, so it is a one-to-many relationship.
|