There are four possible types of relationships within class diagrams.
Association describes the communication between two classes. A multiplicity illustrates the various possibilities available and is expressed in a minimum and maximum value. The term cardinalities is also used in UML to describe the number of actual manifestations. The term cardinality originally comes from data modelling and has the same meaning as a multiplicity in UML. The cardinality describes, for example, the exact number of associated objects in an object model.
An aggregation describes a partial relationship. An aggregation illustrates how the whole is comprised of parts. The relevant classes have equal value. Aggregations are represented by a line and an arrow between two classes as well as with a # sign. This symbol can be seen on the aggregate’s page – referring to the whole.
A composition is a strict form of aggregation. It differs from it in that the existence of an object which is part of the whole, is dependent on the existence of the whole. In that regard an object can only be part of, at most, one whole (multiplicity 0..1 or 1). Dependency in this context refers to the entire life cycle of various parts – that is, the object, which represents the whole, also takes responsibility for the entire life cycle of the objects whose parts it represents. If the whole is deleted then the objects that belonged to it at that point also disappear.
A generalization is a directed relationship between a general and a special class. Special classes are also part of general classes. That means that the special class has all the properties (structure and behavior) of the general class. These are implicit properties because they are not expressly declared, the special class inherits them from the general class.