liveBook · Manning

Concrete class

As explained in Software Design for Python Programmers

A concrete subclass is a non-abstract subclass that implements all abstract methods inherited from its superclass.

A concrete class is a non-abstract subclass that implements every abstract method inherited from its superclass. It can be instantiated, unlike the abstract superclass. section 4.3.4

A concrete subclass typically:

  • Implements required abstract methods such as start_engine() and stop_engine(). section 4.3.4
  • Inherits usable non-abstract methods and may override selected behavior. section 4.3.4

Motor vehicles

MotorVehicle declares start_engine() and stop_engine() abstract. Car implements both and inherits drive(), while Truck implements both and overrides turn_left() and turn_right(). Creating MotorVehicle directly is invalid; creating Car or Truck is valid.

How Software Design for Python Programmers covers it

How deep it goes
Explains required implementations, inheritance, overriding, instantiation, and Python abstract-method declarations.
Examples
Demonstrates Car and Truck implementing MotorVehicle and exercising inherited drive() behavior.
What it assumes
Assumes basic subclassing and methods while defining abstract classes and interface classes alongside the concept.
What you can do after
Build it from scratch by implementing every abstract method before instantiating a subclass.
How it connects
Connects concrete classes to abstract classes, interface classes, inheritance, method overriding, and UML class diagrams.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Design for Python Programmers. The section links point to the parts of the book it draws on.