CLASS RELATIONSHIPS
A class may be involved in one or more relationships with other classes. A relationship can be one of the following types:
- Inheritance (Generalization): Represents an “is-a” relationship. An abstract class name is shown in italics. SubClass1 and SubClass2 are specializations of SuperClass. Generalization.

The relationship is displayed as a solid line with a hollow arrowhead that points from the child element to the parent element.
2. Association
i. Simple association: This is a structural link between two peer classes. There is an association between Class1 and Class2.

The relationship is displayed as a solid line connecting two classes.
Associations can be one of the following two types or not specified.
i. Composition:
Represented by an association line with a solid diamond at the tail end. A composition models the notion of one object “owning” another and thus being responsible for the creation and destruction of another object. A special type of aggregation where parts are destroyed when the whole is destroyed.
Objects of Class2 live and die with Class1. Class2 cannot stand by itself.

This relationship is displayed as a solid line with a filled diamond at the association end, which is connected to the class that represents the whole, or composite.
ii. Aggregation:
Represented by an association line with a hollow diamond at the tail end. An aggregation models the notion that one object uses another object without “owning” it and thus is not responsible for its creation or destruction. It is a special type of association. It represents a “partof” relationship.
Class2 is part of Class1. Many instances (denoted by the *) of Class2 can be associated
with Class1. Objects of Class1 and Class2 have separate lifetimes.

The relationship is displayed as a solid line with an unfilled diamond at the association end, which is connected to the class that represents the aggregate.
DEPENDENCY
A dotted line with an open arrowhead that shows one entity depends on the behavior of another entity. Typical usages are to represent that one class instantiates another or that it uses the other as an input parameter.
It exists between two classes if changes to the definition of one may cause changes to
the other (but not the other way around).
Class1 depends on Class 2.

Class diagram for an ATM system.

Multiplicity
Multiplicity indicates how many objects of a class may relate to the other classes in an association. Multiplicity is shown as a comma-separated sequence of the following:
1. Integer intervals
2. Literal integer values
Intervals are shown as a lower-bound .. upper-bound string in which a single asterisk indicates an unlimited range. No asterisks indicate a closed range. For example, 1 means one, 1..5 means one to five, 1, 4 means one or four, 0..* and * mean zero or more (or many), and 0..1 and 0, 1 mean zero or one. There is no default multiplicity for association ends.
Multiplicity is simply undefined unless you specify it. For example,
- A single worker is responsible for zero or more work products.
- A single work product is the responsibility of exactly one worker.
- A single worker performs zero or more units of work.
- A unit of work is performed by exactly one worker.
- A unit of work may input as a consumer zero or more work products and output as a producer zero or more work products.
- A work product may be consumed as input by zero or more units of work and produced as output by zero or more units of work.
Example to demonstrate multiplicity.

