重构图书索引

来源:互联网 发布:何为网络综艺 编辑:程序博客网 时间:2024/04/29 09:14

  • 【圖書簡介】
      本書清晰地揭示了重構的過程,解釋了重構的原理和最佳實踐方式,并給出了何時以及何地應該開始挖掘代碼以求改善。書中給出了70多個可行的重構,每個重構都介紹了一種經過驗證的代碼變換手法的動機和技術。本書提出的重構準則將幫助你一次一小步地修改你的代碼,從而減少了開發過程中的風險。本書適合軟件開發人員、項目管理人員等閱讀,也可作為高等院校計算機及相關專業師生的參考讀物。
  • 【作者簡介】
      Martin Fowler世界軟件開發大師,在面向對象分析設計、UML、模式、XP和重構等領域都有卓越貢獻,現為著名軟件開發咨詢公司ThoughtWorks的首席科學家。他的多部著作《分析模式》、《UML精粹》和《企業應用架構模式》等都已經成為膾灸人口的經典。
  • 【本書目錄】
    Chapter 1:Refactoring,a First Example 重構,第一個例子 
     The Starting Point 起點 
     The First Step in Refactoring 重構第一步 
     Decomposing and Redistributing the Statement Method 分解并重組slalemenl方法 
     Replacing the Conditional Logic on Price Code with Polymorphism 用多態代替價格條件邏輯代碼 
     Final Thoughts 結語 
    Chapter 2:Principles in Refactoring 重構原則 
     Defining Refactoring 何謂重構 
     Why Should You Refactor? 為何重構 
     When Should You Refactor? 何時重構 
     What Do I Tell My Manager? 怎樣說服經理 
     Problems with Refactoring 重構的問題 
     Refactoring and Design 重構與設計 
     Refactoring and Performance 重構與性能 
     Where Did Refactoring Come From? 重構的起源 
    Chapter 3:Bad Smells in Code(by Kent Beck and Martin Fowler) 代碼壞昧 
     Duplicated Code 重復代碼 
     Long Method 過長方法 
     Large Class 過長類 
     Long Parameter List 過長參數列表 
     Divergent Change 發散式變化 
     Shotgun Surgery 霰彈式修改 
     Feature Envy 特性依戀 
     Data Clumps 數據泥團 
     Primitive Obsession 基本類型偏執 
     Switch Statements switch語句 
     Parallel Inheritance Hierarchies 平行繼承體系 
     Lazy Class 冗余類 
     Speculative Generality 理論上的一般性 
     Temporary Field 臨時字段 
     Message Chains 消息鏈 
     Middle Man 中間人 
     Inappropriate Intimacy 過度親密 
     Alternative Classes with Different Interfaces 接口不同的等效類
     Incomplete Library Class 不完整的庫類 
     Data Class 數據類 
     Refused Bequest 拒絕繼承 
     Comments 注釋過多 
    Chapter 4:Building Tests 構建測試 
     The Value of Self-testing Code 自測試代碼的重要性 
     The JUnit Testing Framework Junit測試框架 
     Adding More Tests 添加更多測試 
    Chapter 5:Toward a Catalog of Refactorings 重構目錄 
     Format of the Refactorings 重構描述的格式 
     Finding References 尋找引用 
     How Mature Are These Refactorings? 這些重構的成熟度如何
    Chapter 6:Composing Methods 組合方法 
     Extract Method 提取方法 
     Inline Method 內聯方法 
     Inline Temp 內聯臨時變量 
     *Replace Temp with Query 用查詢方法代替臨時變量 
     Introduce Explaining Variable 引入解釋性變量 
     Split Temporary Variable 分離臨時變量 
     *Remove Assignments to Parameters 去除參數賦值 
     Replace Method with Method Object 用方法對象代替方法 
     Substitute Algorithm 替換算法 
    Chapter 7:Moving Features Between Objects 在對象之間移動特性
     *Move Method 移動方法 
     Move Field 移動字段 
     Extract Class 提取類 
     Inline Class 內聯類 
     Hide Delegate 隱藏委托類 
     Remove Middle Man 去除中間人 
     Introduce Foreign Method 引入外加方法 
     *Introduce Local Extension 引入本地擴展類 
    Chapter 8:Organizing Data 組織數據 
     Self Encapsulate Field 自封裝字段 
     Replace Data Value with Object 用對象代替數據值 
     Change Value to Reference 將值對象改為引用對象 
     Change Reference to Value 將引用對象改為值對象 
     Replace Array with Object 用對象代替數組 
     Duplicate Observed Data 重復被觀察數據 
     *Change Unidirectional Associationto Bidirectional 將單向關聯改為雙向 
     Change Bidirectional Association to Unidirectional 將雙向關聯改為單向 
     *Replace Magic Number with Symbolic Constant 用字面常量代替魔數 
     Encapsulate Field 封裝字段 
     Encapsulate Collection 封裝集合 
     Replace Record with Data Class 用數據類代替記錄 
     *ReplaceType Code with Class 用類代替類型碼 
     Replace Type Code with Subclasses 用子類代替類型碼 
     Replace Type Code with State/Strategy用State/Strategy 代替類型碼 
     Replace Subclass with Fields 用字段代替子類 
    Chapter 9:Simplifying Conditional Expressions 簡化條件語句 
     Decompose Conditional 分解條件語句 
     Consolidate Conditional Expression 合并條件語句 
     Consolidate Duplicate Conditional Fragments 合并重復的條件片段 
     Remove Control Flag 去除控制標志 
     Replace Nested Conditional with Guard Clauses 用守衛語句代替嵌套條件語句 
     Replace Conditional with Polymorphism 用多態代替條件語句  Introduce Null Object 引入Null對象 
     Introduce Assertion 引入斷言 
    Chapter 10:Making Method Calls Simpler 簡化方法調用 
     Rename Method 重命名方法 
     Add Parameter 添加參數 
     Remove Parameter 去除參數 
     Separate query from Modifier 將查詢方法與修改方法分離
     Parameterize Method 參數化方法
     Replace Parameter with Explicit Methods 用顯式方法代替參數
     Preserve Whole Object 保持對象完整
     Replace Parameter with Method 用方法代替參數 
     Introduce Parameter Object 引入參數對象
     Remove Setting Method 去除設置方法 
     Hide Method 隱藏方法 
     Replace Constructor with Factory Method 用工廠方法代替構造器
     Encapsulate Downcast 封裝向下轉型 
     Replace Error Code with Exception 用異常代替錯誤碼 
     Replace Exception with Test 用測試代替異常
    Chapter 11:Dealing with Generalization 處理泛化關系 
     Pull Up Field 上移字段 
     Pull UP Method 上移方法 
     Pull Up Constructor Body 上移構造器主體 
     Push Down Method 下移方法
     Push Down Field 下移字段 
     Extract Subclass 提取子類 
     Extract Superclass 提取超類
     Extract Interface 提取接口
     Collapse Hierarchy 合并繼承層次 
     Form Template Method 形成Template Method 
     Replace Inheritance with Delegation 用委托代替繼承 
     Replace Delegation with Inheritance 用繼承代替委托5
    Chapter 12:Big Refactorings(by Kent Beck and Martin Fowler) 大型重構 
     Tease Apart Inheritance 分解繼承層次 
     Convert Procedural Design to Objects 將過程式設計轉換為面向對象 
     Separate Domain from Presentation 將領域邏輯與表現分離
     Extract Hierarchy 提取繼承層次
    Chapter 13:Refactoring,Reuse,and Reality(by William Opdyke) 重構,復用與現實
     A Reality Check 現實的檢驗
     Whv Are Developers Reluctant to Refactor Their Programs? 開發人員為何不愿重構程序
     A Reality Check(Revisited) 再談現實的檢驗
     Resources and References for Refactoring 重構的資源和參考文獻 
     Implications Regarding Software Reuse and Technology Transfer 對軟件復用與技術傳播的意義 
     A Final Note 結語 
     References 參考文獻 
    Chapter 14:Refactoring Tools(by Don Roberts and John Brant) 重構工具 
     Refactoring with a Tool 使用工具重構
     Technical Criteria for a Refactoring Tool 重構工具的技術標準 
     Practical Criteria for a Refactoring Tool 重構工具的實用標準
     Wrap Up 結語 
    Chapter 15:Putting It All Together(by Kent Beck) 集大成 
    References參考文獻 
    List of Soundbites 要點列表
    Updates 更新內容 
    Index 索引