←
^
→
Introduction to 492 and Decoupling
Polymorphism
A container part C will often depend on the part E which provides the elements of the container.
For example, C might want to compare two elements for equality to make sure it is not adding the same element twice.
In some cases we can make C
polymorphic
which means that C is written without any mention of special characteristics of E.
For example, in Java all classes are descendant of
Object
. So, a container that takes elements of type
Object
is as polymorphic as can be.
Lower degrees or polymorphism are more common, as when a part takes arguments of a given interface type.
José M. Vidal
.
25 of 34