Reference Pointers
This is the module's "read only if stuck" layer. If the concept page and practice pages have done their job, you should not need most of these links. Use this page when a specific move's mechanics are not landing, or when a reviewer asks "where does this pattern come from?" and you want the canonical source.
Source Roles in This Module
| Book | Role | Cluster(s) used |
|---|---|---|
| Refactoring (Fowler) | Primary -- the canonical catalog | 1, 3, 4, 5 |
| Working Effectively with Legacy Code (Feathers) | Selective support -- seams and characterization | 2 |
| Clean Code (Martin) | Selective support -- naming and function length pressure | 3 |
| Good Code, Bad Code (Hansen) | Selective support -- engineering-judgment framing | 1, 3, 4 |
| Head First Design Patterns, OOAD | Background -- the design destinations many refactors head toward | 4 |
Read Only If Stuck -- by Cluster
Cluster 1: The Refactoring Discipline
If you cannot articulate why behavior preservation is the non-negotiable property:
If "when to refactor" is still vague:
- Refactoring ch. 2: When Should We Refactor? (Part 1)
- Refactoring ch. 2: When Should We Refactor? (Part 2)
If a manager is blocking you and you want the argument:
Cluster 2: Tests as a Safety Net
If the value of self-testing is not yet obvious:
If you've never written a characterization test:
- Refactoring ch. 4: Sample code and a first test
- Refactoring ch. 4: Modifying the Fixture and Probing the Boundaries
If you've never introduced a seam:
- martinfowler.com/bliki/LegacySeam.html -- modern retelling with code
- Feathers, Working Effectively with Legacy Code, ch. 4 "The Seam Model" and ch. 25 "Dependency-Breaking Techniques" (external book)
Cluster 3: Fundamental Refactor Moves
When the mechanics of Extract Function fight you:
When Inline Function is the right answer and you cannot justify it:
When you reach for Rename and the scope is unclear:
When Change Function Declaration feels risky:
When Move Function's steps blur together:
When Split Phase vs Extract Function is ambiguous:
When Encapsulate Record seems like ceremony:
When Replace Primitive with Object pays back less than expected:
Cluster 4: Reorganizing Data and Logic
When Decompose Conditional seems redundant:
When consolidating guards or flattening nests:
When Replace Conditional with Polymorphism's recurrence requirement is unclear:
- Refactoring ch. 10: Replace Conditional with Polymorphism (Part 1)
- Refactoring ch. 10: Replace Conditional with Polymorphism (Part 2)
When you can't decide between Parameter Object and Preserve Whole Object:
- Refactoring ch. 11: Preserve Whole Object
- Refactoring ch. 6: Introduce Parameter Object (second half)
Cluster 5: Refactoring Large Changes and Rollout
When a refactor is too big for a single commit:
- martinfowler.com/bliki/ParallelChange.html -- Danilo Sato's expand / migrate / contract
- martinfowler.com/bliki/BranchByAbstraction.html -- Paul Hammant's abstraction technique
When the system is too large to refactor in place:
- martinfowler.com/bliki/StranglerFigApplication.html
- martinfowler.com/articles/patterns-legacy-displacement/
When a manager pushes back on incremental structural change:
Optional Deep Dive
You can ignore this section entirely and still pass the module. Open one of these only if a specific question keeps returning after you've worked the concept and practice pages:
- Refactoring ch. 1: end-to-end example parts 1-7 through part 7 -- the full
statementcase study; read only as a whole, not piecemeal. - Refactoring ch. 3: Mysterious Name -> Comments (smell catalog) through 031 -- the smell catalog; lives primarily in Module 1 but is cross-referenced for smell-to-move mapping.
- Refactoring ch. 12: Replace Subclass with Delegate -- when LSP violations (Module 1) meet an inheritance hierarchy.
- Feathers, Working Effectively with Legacy Code, chs. 6 "I Don't Have Much Time and I Have to Change It" and 24 "We Feel Overwhelmed. It Isn't Going to Get Any Better."
Concept-to-Source Map
A compact crosswalk. Every primary concept maps to at least one chunk.
| Concept | Type | Primary chunk(s) |
|---|---|---|
| 01 Refactoring is behavior preservation | PRIMARY | 013 |
| 02 The two hats | PRIMARY | 013, 014 |
| 03 When to refactor | PRIMARY | 015, 016 |
| 04 Characterization tests | PRIMARY | 032, 035 |
| 05 Legacy seams and enabling points | PRIMARY | 032 + martinfowler.com/bliki/LegacySeam.html |
| 06 Test granularity | SUPPORTING | 033, 036 |
| 07 Extract Function / Inline Function | PRIMARY | 038, 039, 040 |
| 08 Extract Variable / Rename / Change Declaration | PRIMARY | 041, 043, 045 |
| 09 Move Function / Move Field / Split Phase | PRIMARY | 056, 058, 048 |
| 10 Encapsulate Record / Replace Primitive | PRIMARY | 049, 052 |
| 11 Replace Conditional with Polymorphism | PRIMARY | 068, 069 |
| 12 Parameter Object / Preserve Whole Object | SUPPORTING | 045, 074 |
| 13 Decompose / Consolidate Conditional | SUPPORTING | 066, 067 |
| 14 Branch by Abstraction / Parallel Change | PRIMARY | 020 + external Fowler bliki |
| 15 Strangler refactors | SUPPORTING | 019 + external Fowler bliki / articles |