Relationships
A relationship between two classes is a UML entity that represents the fact that the classes are somehow related to each other. Examples of relationships are:
association— class A is associated with class B.
aggregation— class A aggregates class B.
inheritance— class A inherits from class B.
realization— class A implements interface IB.
We will give examples of all these types of relationships shortly.
We can classify relationships in two general categories: has-a type of relationships (when we can say that an object of type A has an object of type B), and is-a relationships (when we can say that an object of type A is also of type B). Association and aggregation are has-a relationships. Inheritance and realization are is-a type ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access