An abstract class defines shared structure and required behavior without allowing direct instantiation. In Python, it derives from abc.ABC and declares required methods with @abstractmethod. Concrete subclasses must implement every abstract method; otherwise, they remain abstract. The superclass may also provide instance variables and reusable non-abstract methods. section 4.3.4
MotorVehicle, Car, and Truck
MotorVehicle requires start_engine() and stop_engine(), while supplying drive(), accelerate(), steering, and braking behavior. Car implements the required engine methods and inherits the rest. Truck implements them and overrides steering. Calling drive() on either concrete object reuses the superclass sequence while preserving vehicle-specific behavior. section 4.3.4 section 4.7
Figure 8.3 This version of the application is modeled from the Template Method Design Pattern. The abstract superclass GameReport outlines the steps in the proper order for the algorithm to generate a report. It implements the common steps _print_header() and _print_footer() and delegates the remaining steps _acquire_data(), _analyze_data(), and _print_report() to the BaseballReport and VolleyballReport subclasses. The public template method generate_report() in the superclass calls the step methods in the proper order. The grayed-out portions of the diagram haven’t changed logically from figures 8.1 and 8.2.
Shows an abstract GameReport superclass fixing report-generation order, implementing common steps, and delegating variable steps to subclasses. section 8.1.3





