Reading diagrams / Topic 11 of 42

Tiles and their groups

The rule

The layer diagram opens as tiles in rows. Each shaded row is built only from the rows below it, though not always the one just below. It is the levels rule from earlier, drawn without arrows, with each group counted as one block. So the rows are numbered “row 0”, “row 1” and up, not by level: a row counts a group as one box, and a package's row number moves with the grouping. A row number is not a package's level. Each tile prints its uses from the rest of the program and has one of the three heights, as in the last topic.

The tiles also gather packages into groups. You choose what alike means: the packages they connect to, the types they share, or the tables they touch. Packages that are alike on that one dimension share a framed tile. Inside a tile, each package sits above the ones it is built from. A group never mixes levels in a way that would make an arrow point up.

A group is computed from imports and types alone. It says these packages are alike on the dimension you picked. It does not say the authors meant them to belong together; that is in their own design notes. Comparing the two is how you find code that has drifted from its design.

Change the dimension and the groups change. Pager and Btree connect to the same packages, but they share few types.

SQLite, grouped by the packages they connect to.

Loading the layer diagram.

The same program, grouped by the types they share.

Loading the layer diagram.

Loading the worked examples and practice.