Tutorial 1 of 8 · Low-level design · Building blocks · Intermediate
Reading and drawing class diagrams
Draw classes as boxes and their links as arrows, so you can plan a program before you write it.
5 lessons, the last is a challenge · about 1 h · Python and Java
Before you start
You finished "Objects that share behaviour": you can write a child class with super, override a method, and you have met an abstract class, a Java interface and "has a" with a Car and its Engine.
1Read a class box aloud: its name, its fields and methods, the + and - in front of them, and the types written the Java way.
2Tell the six kinds of line apart by their style and their ends, and say each as a short sentence: is a, can do, owns, holds, knows about, needs for a moment.
3Choose between composition and aggregation by asking who makes the part and whether it lives on without the whole, and read how many from a label such as 0..*.
4Write the classes a small diagram shows, in Python or Java, and draw the diagram of a small program from its code.