文档介绍:Table of Contents
Copyright................................................................................................................................ 1
Foreword................................................................................................................................ 3
Preface................................................................................................................................... 4
Chapter 1. Refactoring, a First Example.................................................................................. 9
The Starting Point........................................................................................................................................................................................................................... 9
The First Step in Refactoring......................................................................................................................................................................................................... 13
posing and Redistributing the Statement Method............................................................................................................................................................ 13
Replacing the Conditional Logic on Price Code with Polymorphism........................................................................................................................................... 27
Final Thoughts............................................................................................................................................................................................................................... 34
Chapter 2. Principles in Refactoring..................................................................................... 35
Defining Refactoring.....................................................................................................................................................