Beyond the structure of individual classes, object-oriented systems are defined by how objects relate to one another. Association is the most general form of relationship, where one object uses or interacts with another without either owning the other. A Teacher and a Student, for example, are associated because they interact, yet neither contains the other. Associations can be unidirectional, where only one side knows about the relationship, or bidirectional, where both sides are aware of each other. Association is the weakest form of object relationship.
Aggregation is a specialized form of association that represents a whole-part relationship in which the part can exist independently of the whole. A Department containing Professor objects illustrates this idea: if the department were dissolved, the professors would still exist. In UML diagrams, aggregation is depicted with a hollow diamond on the whole side, signifying weak ownership. The relationship is therefore one of usage rather than true containment, representing a has-a relationship with weak ownership.
Composition represents the strongest form of whole-part relationship, where the part cannot exist without the whole. A House containing Room objects is a typical example, since rooms do not exist independently of their house. If the house is destroyed, so are its rooms. In UML, composition is shown with a filled diamond, and the parts share their lifecycle with the whole, representing strong ownership and a strict lifecycle dependency. The progression from association through aggregation to composition reflects an increasing strength of coupling, with association being the loosest and composition the tightest.