Skip to main content

Reference and Selective Reading

You do not need to read the source books front-to-back for this module. Use the concept pages and practice pages first. Open these local chunks only when you need alternate exposition, more worked examples, or a deeper exercise lane.

Source Roles

SourceRoleWhy it is here
Head First Design PatternsPrimary narrativeBest on-ramp for every pattern in this module. Tone is informal; pedagogy is strong
Design Patterns (GoF)Canonical vocabularyPrecise intent, participants, collaborations, and "known uses". Terse and authoritative
Refactoring (Fowler)Refactor movesUse when a pattern is the endpoint of a refactor, not a greenfield design
Clean Code (Martin)ReadabilityUse to resist over-patterning and to see switches as a code quality issue
Good Code, Bad Code (Hansen)Engineering judgmentUse for cost/benefit arguments on pattern adoption
OOADFSM modelingUse specifically when the State cluster needs deeper structural backing

Read Only If Stuck

Cluster 1: Strategy and Polymorphic Variation

Cluster 2: Observer and Event Notification

Cluster 3: Command and Action Encapsulation

Cluster 4: State and Behavior-Switching Patterns

Cluster 5: Traversal and Processing Patterns

Optional Deep Dive

Concept-to-Source Map

Primary conceptBest source if stuckWhy this source
Strategy: encapsulating interchangeable algorithmsHF: Integrating the Duck BehaviorsRefactor-driven derivation of the pattern
Strategy vs function references and closuresGoF: Strategy ApplicabilityExplicit trade-offs and when not to pattern
Template Method: fixed skeleton with variable stepsHF: Template Method Pattern DefinedClean definition and hook discussion
Observer: publishing state changes without couplingHF: The Power of Loose CouplingBest statement of the dependency direction
Observer pitfallsGoF: Observer ImplementationDiscusses update protocols and lapsed-listener problems
Push vs pull and Pub/SubGoF: Observer CollaborationsPrecise vocabulary for both
Command: making actions first-classHF: The Command Pattern DefinedSharp role definitions
Undo/redo and command historyGoF: Command ImplementationConcrete undo discussion
Command queues, logging, replayHF: Logging RequestsShortest path to the replay mental model
State patternHF: The State Pattern DefinedDirect and short
State vs switch/if chainsRefactoring: Replace Conditional with Polymorphism (Part 1)The mechanical move
FSM modelingOOAD: FSM -- A Simple ExampleExplicit state/event/transition framing
IteratorHF: Can We Encapsulate the Iteration?The extraction move
Chain of ResponsibilityGoF: Chain of Responsibility ImplementationImplementation choices and stop conditions
Visitor and double dispatchGoF: Visitor ImplementationMost direct treatment of the double-dispatch idea