Summary:
Now you can dramatically improve the design, performance, and manageability of object-oriented code without altering its interfaces or behavior. Refactoring shows you exactly how to spot the best opportunities for refactoring and exactly how to do it-step by step. Through more than forty detailed case studies, you'll learn powerful - and surprisingly simple - ways to redesign code that is already in production. You'll learn scores of specific techniques, including when to move fields between classes, when to move code up or down its hierarchy, and when to divide a single method into two. Through intuition and trial and error, master programmers have spent years evolving these techniques; this book brings them all together into a comprehensive guide that any experienced developer can use.
Table of Contents:
Foreword ..... xiii
Preface ..... xv
Chapter 1: Refactoring, a First Example ..... 1
Chapter 2: Principles in Refactoring ..... 53
Chapter 3: Bad Smells in Code (by Kent Beck and Martin Fowler) ..... 75
Chapter 4: Building Tests ..... 89
Chapter 5: Toward a Catalog of Refactorings ..... 103
Chapter 6: Composing Methods ..... 109
Chapter 7: Moving Features Between Objects ..... 141
Chapter 8: Organizing Data ..... 169
Chapter 9: Simplifying Conditional Expressions ..... 237
Chapter 10: Making Method Calls Simpler ..... 271
Chapter 11: Dealing with Generalization ..... 319
Chapter 12: Big Refactorings (by Kent Beck and Martin Fowler) ..... 359
Chapter 13: Refactoring, Reuse, and Reality (by William Opdyke) ..... 379
Chapter 14: Refactoring Tools 401 (by Don Roberts and John Brant)
Chapter 15: Putting It All Together (by Kent Beck) ..... 409
References ..... 413
List of Soundbites ..... 417
List of Refactorings ..... 419
Index ..... 421