= Solution
<Class inheritance> defines a subclass by extending another class's behavior, often with <method overriding> and <subtyping>. An editor might have an abstract `Command` type with `execute`, and subclasses for insertion and deletion. The controller keeps commands through the common type and <dynamic dispatch> chooses each command's actual operation. Alternatively, a specialized document can extend a base document's documented behavior. \b[An inheritance relationship used for substitution must preserve the superclass contract]; borrowing its code alone does not justify exposing incompatible behavior. Commands exemplify the <Command pattern> without exposing document storage to the controller.
Back to article page