Skip to main content

Learning Resources

This module is populated from the local chunked books in library/raw/semester-03-software-design/books. Use this page as a source map, not as an instruction to read everything.

Source Stack

BookRoleHow to use it in this module
Head First Design PatternsPrimary teaching sourceDefault narrative for Strategy, Observer, Command, Template Method, Iterator, State, and Chain of Responsibility
Design Patterns (GoF)Canonical pattern vocabularyReach for it when you want the precise intent, participants, and "known uses" of a pattern
Refactoring (Fowler)"Replace X with Y" moves that produce patternsUse when you arrive at a pattern by refactoring, not by greenfield design
Clean Code (Martin)Readability and simplicityUse to push back on over-patterning and keep patterns small
Good Code, Bad Code (Hansen)Engineering judgmentUse when deciding whether a pattern's cost is worth its flexibility
OOADState machine modelingUse specifically for the State cluster's FSM concepts

Resource Map by Cluster

Cluster 1: Strategy and Polymorphic Variation

NeedBest local chunkWhy
narrative introductionHF: Designing the Duck BehaviorsClassic Strategy motivation by a refactor story
integrating and testingHF: Integrating the Duck BehaviorsShows composition over inheritance in practice
first-class pattern vocabularyHF: Speaking of Design PatternsNames the concepts used later
canonical definitionGoF: Strategy ApplicabilityPrecise "use when" list
template method skeletonHF: Template Method Pattern DefinedClean statement of the pattern
hooks as optional stepsHF: Hooked on Template MethodGood intuition for hook discipline
refactor into StrategyRefactoring: Replace Conditional with Polymorphism (Part 1)Shows the mechanical move

Cluster 2: Observer and Event Notification

NeedBest local chunkWhy
subject/observer intuitionHF: The Observer PatternStrongest narrative introduction
loose coupling messageHF: The Power of Loose CouplingBest explanation of the dependency direction
weather-station walkthroughHF: Power Up the Weather StationConcrete end-to-end implementation
formal collaborationsGoF: Observer CollaborationsPrecise shape and responsibilities
implementation choicesGoF: Observer ImplementationWeak refs, notification policies, and more
pub/sub class diagramHF: Observer Pattern Class DiagramUseful when you need the picture in hand

Cluster 3: Command and Action Encapsulation

NeedBest local chunkWhy
first narrativeHF: 6 The Command PatternBest initial motivation
pattern definitionHF: The Command Pattern DefinedParticipants and intent
remote control exampleHF: Assigning Commands to SlotsInvoker/receiver separation made concrete
logging and replayHF: Logging RequestsBest example of queued/replayable commands
canonical vocabularyGoF: Command Class and SubclassesFormal roles
implementation choicesGoF: Command ImplementationUndo strategies, stateful commands
promoting a functionRefactoring: Replace Function with CommandMechanical move into Command
demoting when overkillRefactoring: Replace Command with FunctionMechanical move out of Command

Cluster 4: State and Behavior-Switching Patterns

NeedBest local chunkWhy
first narrativeHF: 10 The State PatternGumball machine story; the clearest introduction
implementationHF: Implementing Our State ClassesConcrete state classes
pattern definitionHF: The State Pattern DefinedParticipants and intent
consequencesGoF: State ConsequencesBest trade-off summary
FSM vocabularyOOAD: FSM -- A Simple ExampleClean state/event/transition framing
conditional-to-polymorphismOOAD: Replacing Event Conditionals with PolymorphismRefactor move anchored in FSM theory
repeated switches smellRefactoring: Repeated SwitchesThe smell that triggers the refactor
switches and their costsClean Code: Switch StatementsReadability angle on the same problem

Cluster 5: Traversal and Processing Patterns

NeedBest local chunkWhy
iterator narrativeHF: 9 The Iterator and Composite PatternsClear motivation
encapsulating iterationHF: Can We Encapsulate the Iteration?The extraction move
language integrationHF: Meet Java's Iterable InterfaceUseful for seeing how languages expose iterators
iterator canonicalGoF: Iterator ImplementationImplementation choices
chain of responsibility narrativeHF: Chain of ResponsibilityCompact introduction
chain canonicalGoF: Chain of Responsibility ImplementationRoles and dispatch choices
chain real-worldGoF: Chain of Responsibility Known UsesGrounding in real systems
visitor canonicalGoF: Visitor ApplicabilityWhen to pay the ceremony
visitor implementationGoF: Visitor ImplementationDouble dispatch in detail

External Resources (Validated)

Use sparingly; the local chunks come first. Each link below was reachable at the time this module was written and is useful for a quick second-pass view or diagram.

Cluster 1

Cluster 2

Cluster 3

Cluster 4

Cluster 5

Use Rules

  • Stuck on intent or naming? Read Head First first. It is the shortest path back on your feet.
  • Stuck on precise responsibilities or trade-offs? Read GoF. It is terse but authoritative.
  • Arrived at the pattern by refactoring? Go to Refactoring for the mechanical move, not a pattern book.
  • Tempted to add a fifth class "just in case"? Read the relevant Clean Code heuristic and reconsider.
  • One chunk per one question. Do not wander through a chapter by default.