Reading UML Class Diagrams
Reading UML class diagrams: the boxes, lines and arrowheads every design pattern is drawn with, and how each relationship looks in code.
Every design pattern is usually drawn before it is written, as a UML class diagram: boxes for classes and lines between them. Reading those diagrams fluently is what lets you take a pattern from a book, a colleague's whiteboard or this subject's own cards, and see the code it implies.
This topic is a reading key for the part of UML that patterns use. It starts with the marks inside one class box, then the six relationships drawn between boxes, each with its own line and arrowhead. A walkthrough reads one pattern's diagram aloud, box by box, and a code card writes the same diagram in Python, Java and TypeScript, so that each arrow has a line of code to match.
Structure is not the whole story, so the topic also covers sequence diagrams, which show the calls of one run in order. It closes on the mistake most often made in both directions, the diamond drawn on the wrong end, and an exercise that turns a listing back into a diagram.
By the end you can read a class box, name a relationship from its arrow, turn either into code, and follow a sequence diagram from the first call to the last.
Contents
8 cardsnot started