Association (object-oriented programming)

In object-oriented programming, association defines a relationship between classes of objects that allows one object instance to cause another to perform an action on its behalf.

In generic terms, the causation is usually called "sending a message", "invoking a method" or "calling a member function" to the controlled object.

Concrete implementation usually requires the requesting object to invoke a method or member function using a reference or pointer to the memory location of the controlled object.

A role can be used to distinguish two objects of the same class when describing its use in the context of the association.

A role describes the public aspects of an object with respect to an association.

Top: A bidirectional association
Middle: An association is bidirectional, although it may be limited to just one direction by adorning some end with an arrowhead pointing to the direction of traversal.
Bottom: Association is prohibited