Antipatterns from the Textbook

SENG 365 — Software Engineering

Neil Ernst

University of Victoria

2026-10-30

Antipatterns

Antipatterns: Duplication, God Class, Intimacy

Antipattern Symptom Pages
Duplicated Code The same logic is written in several places, so each change must be repeated. 11, 109, 158, 159, 183, 190, 235, 248, 251, 252 (index: 252). p. 178 spells it “Code Duplication”.
God Class One class collects data and behaviour until it knows and does everything. 125 (ch. opener), 127, 139, 222 (index: 127)
Inappropriate Intimacy Classes work through each other’s internals, for example only via getters and setters. 13 (ch. opener), 25

Antipatterns: Methods and Chains

Antipattern Symptom Pages
Long Method A method is too long or complex to read at a glance. 11, 67 (ch. opener), 81, 95 (index: 81)
Message Chain Client code navigates through a chain of objects, so it depends on the structure behind them. 125 (ch. opener), 154
Pairwise Dependencies Every component updates every other directly to keep shared state in step. 193 (ch. opener), 195, 238 (index: 194)

Antipatterns: Primitives and Generality

Antipattern Symptom Pages
Primitive Obsession Ints and strings stand in for domain concepts that deserve their own abstraction. 13 (ch. opener), 16, 17, 21, 22, 40 (index: 15)
Speculative Generality Flexibility is built in for needs that may never arise. 67 (ch. opener), 73, 228, 253 (index: 73, 253)

Antipatterns: Branching and Fields

Antipattern Symptom Pages
Switch Statement Code branches on a type or flag where separate objects could carry the behaviour. 43 (ch. opener), 51, 139, 144, 147, 184, 213 (index: 51)
Temporary Field A field is used only under limited conditions and is not part of the object’s essential state. 67 (ch. opener), 73, 95 (index: 73)