Tutorial 7 of 8 · Low-level design · Case studies · Intermediate
Design a parking lot
Turn a paragraph of requirements into classes, arrows and working code, one careful step at a time.
6 lessons, the last is a challenge · about 1 h 30 min · Python and Java
Before you start
You finished "Three patterns you will meet first": you can read a class diagram with its arrows and diamonds, you know why a rule that may change gets its own class, and you can write an abstract class with children in Python or Java.
1Ask the questions that turn a vague task such as "design a parking lot" into a short, agreed list of requirements, and say what is out of scope.
2Pick the classes, the fields and the methods out of a requirement paragraph, and draw them as a class diagram with the right kind of line between each pair.
3Write and read a working skeleton of the design in Python or Java, and predict the fee and the spot it gives for a new case.
4Follow one park and one unpark through the objects with a sequence diagram, and predict the state of the lot after a run of events.