Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Foreword by Ralph Johnson
Foreword by Martin Fowler
Preface
What Is This Book About?
What Are the Goals of This Book?
Who Should Read This Book?
What Background Do You Need?
How to Use This Book
The History of This Book
Standing on the Shoulders of Giants
Acknowledgments
Chapter 1: Why I Wrote This Book
Over-Engineering
The Patterns Panacea
Under-Engineering
Test-Driven Development and Continuous Refactoring
Refactoring and Patterns
Evolutionary Design
Chapter 2: Refactoring
What Is Refactoring?
What Motivates Us to Refactor?
Many Eyes
Human-Readable Code
Keeping It Clean
Small Steps
Design Debt
Evolving a New Architecture
Composite and Test-Driven Refactorings
The Benefits of Composite Refactorings
Refactoring Tools
Chapter 3: Patterns
What Is a Pattern?
Patterns Happy
There Are Many Ways to Implement a Pattern
Refactoring to, towards, and away from Patterns
Do Patterns Make Code More Complex?
Pattern Knowledge
Up-Front Design with Patterns
Chapter 4: Code Smells
Duplicated Code
Long Method
Conditional Complexity
Primitive Obsession
Indecent Exposure
Solution Sprawl
Alternative Classes with Different Interfaces
Lazy Class
Large Class
Switch Statements
Combinatorial Explosion
Oddball Solution
Chapter 5: A Catalog of Refactorings to Patterns
Format of the Refactorings
Projects Referenced in This Catalog
XML Builders
HTML Parser
Loan Risk Calculator
A Starting Point
A Study Sequence
Chapter 6: Creation
Replace Constructors with Creation Methods
Motivation
Mechanics
Example
Variations
Move Creation Knowledge to Factory
Motivation
Mechanics
Example
Encapsulate Classes with Factory
Motivation
Mechanics
Example
Variations
Introduce Polymorphic Creation with Factory Method
Motivation
Mechanics
Example
Encapsulate Composite with Builder
Mechanics
Example
Variations
Inline Singleton
Motivation
Mechanics
Example
Chapter 7: Simplification
Compose Method
Motivation
Mechanics
Example
Replace Conditional Logic with Strategy
Motivation
Mechanics
Example
Move Embellishment to Decorator
Motivation
Mechanics
Example
Replace State-Altering Conditionals with State
Motivation
Mechanics
Example
Replace Implicit Tree with Composite
Motivation
Mechanics
Example
Replace Conditional Dispatcher with Command
Motivation
Mechanics
Example
Chapter 8: Generalization
Form Template Method
Motivation
Mechanics
Example
Extract Composite
Motivation
Mechanics
Example
Replace One/Many Distinctions with Composite
Motivation
Mechanics
Example
Replace Hard-Coded Notifications with Observer
Motivation
Mechanics
Example
Unify Interfaces with Adapter
Motivation
Mechanics
Example
Extract Adapter
Motivation
Mechanics
Example
Variations
Replace Implicit Language with Interpreter
Motivation
Mechanics
Example
Chapter 9: Protection
Replace Type Code with Class
Motivation
Mechanics
Example
Limit Instantiation with Singleton
Motivation
Mechanics
Example
Introduce Null Object
Motivation
Mechanics
Example
Chapter 10: Accumulation
Move Accumulation to Collecting Parameter
Motivation
Mechanics
Example
Move Accumulation to Visitor
Motivation
Mechanics
Example
Chapter 11: Utilities
Chain Constructors
Motivation
Mechanics
Example
Unify Interfaces
Motivation
Mechanics
Example
Extract Parameter
Motivation
Mechanics
Example
Afterword by John Brant and Don Roberts
References
Index
← Prev
Back
Next →
← Prev
Back
Next →