<<< Inheritance | Index | Run-time polymorphism vs. parametric polymorphism >>> |
We want our main function to know as little as possible.
C++ class hierarchy is a design that supports polymorphism.
Polymorphism stands for uniform interface.
Printer example is based on run-time polymorphism,
also known as ad-hoc polymorphism:
Programmer determines a finite numbers of polymorhic behaviors.
Program delegates control to the class responsible for the implementation of each particular command.
<<< Inheritance | Index | Run-time polymorphism vs. parametric polymorphism >>> |