English
Topic 11. Abstract classes, interfaces and multiple inheritance
Goal: learn to apply the concepts of the topic “Abstract classes, interfaces and multiple inheritance” in console projects; justify the invariants and the contract of operations; test ordinary and edge cases.
Lecture contents
- Abstract classes and NVI — An abstract class and a pure virtual operation · NVI: a stable wrapper and a variable step
- Virtual base and Strategy — The diamond and a virtual base · Strategy through composition
- Interfaces and interaction patterns — A pure virtual destructor and a function definition · Multiple interfaces and name ambiguity · The subobject model and ABI · Observer: subscription and lifetime · Command: execution and history · Mixins, composition and hierarchy size
- Case studies and common mistakes — Auditing an interface before implementation · Checking abstractions and common failures · The limits of composition with discount strategies · What happens to events during unsubscription · The undo and redo history invariant