Dynamic Polymorphism - GerdHirsch/Cpp-TemplateBasics GitHub Wiki

One type of polymorphism in C++ is called dynamic polymorphism.
This design is necessary if the environment must be exchangeable at runtime.

In dynamic polymorphism, the component itself can be a normal class that contains pointers to the abstractions.

The abstractions are represented by base classes with virtual functions that are mostly pure virtual.
The implementations can thus be exchanged at runtime, that is the advantage.
The implementations represent different variants of the environment.
The disadvantage of this is that
objects of the Implementations require a larger amount of memory for the pointer to the virtual function table
and a small runtime overhead for calling the virtual functions.

Dynamic Polymorphism

see the C++ Implementation of the Example
and the usage

next Static Polymorphism