Skip to content

Lesson 10 · Python

Object-Oriented Capstone — Design a Real Program

The OOP module's capstone: turn a plain-English spec into a class design, build a working task tracker with a frozen Task, an iterable TaskList and a command loop, and verify it honestly by hand.

60 minintermediateObject-Oriented Design

Prerequisites: Object-Oriented Design: Dunder Methods, Iterators & Generators

Learning objectives
By the end of this lesson, you will be able to:
  • Turn a plain-English spec into a class design: mine it for nouns and decide what each becomes - class, field or function
  • Build a domain model from parts: a frozen Task value object and a rule-owning TaskList container, joined by composition rather than inheritance
  • Implement protocol methods so a container is iterable, len-able and readable while its internals stay private
  • Keep a program testable by pushing input and output to the edges: a command loop of plain functions over the model
  • Verify a program by hand - checklist, assertion script, piped session - and state honestly what manual testing cannot catch