Here the basic elements are represented as abstract base classes, on which algorithms with dynamic polymorphism can be built.