原始下載點:refactoring-ch1-ch6.pdf
備份下載點:refactoring-ch1-ch6.pdf
以下只是書本首頁有個「重構列表, Refactoring Lists」,為查詢方便,記錄一下。
- Add Parameter ( 添加參數 )
 - Change Bidirectional Association to Unidirectional ( 將雙向關聯改為單向 )
 - Change Reference to Value ( 將引用物件改為實值物件 )
 - Change Unidirectional Association to Bidirectional ( 將單向關聯改為雙向 )
 - Change Value to Reference ( 將實值物件改為引用物件 )
 - Collapse Hierarchy ( 摺疊繼承體系 )
 - Consolidate Conditional Expression ( 合併條件式 )
 - Consolidate Duplicate Conditional Fragments ( 合併重複的條件片段 )
 - Convert Procedural Design to Objects ( 將程序式設計轉化為物件設計 )
 - Decompose Conditional ( 分解條件式 )
 - Duplicate Observed Data ( 複製「被監視資料」 )
 - Encapsulate Collection ( 封裝群集 )
 - Encapsulate Downcast ( 封裝「向下轉型」動作 )
 - Encapsulate Field ( 封裝欄位 )
 - Extract Class ( 提煉類別 )
 - Extract Hierarchy ( 提煉繼承體系 )
 - Extract Interface ( 提煉介面 )
 - Extract Method ( 提煉方法 )
 - Extract Subclass ( 提煉子類別)
 - Extract Superclass ( 提煉超類別 )
 - From Template Method ( 塑造模板函式 )
 - Hide Delegate ( 隱藏「委託關係」 )
 - Hide Method ( 隱藏某個函式 )
 - Inline Class ( 將類別內聯化 )
 - Inline Method ( 將函式內聯化 )
 - Inline Temp ( 將暫時變數內聯化 )
 - Introduce Assertion ( 引入斷言 )
 - Introduce Explaining Variable ( 引入解釋性變數 )
 - Introduce Foreign Method ( 引入外加函式 )
 - Introduce Local Extension ( 引入區域性擴展 )
 - Introduce Null Object ( 引入 Null 物件 )
 - Introduce Parameter Object ( 引入參數物件 )
 - Move Field ( 搬移欄位 )
 - Move Method ( 搬移方法 )
 - Parameterize Method ( 令函式攜帶參數 )
 - Preserve Whole Object ( 保持物件完整 )
 - Pull Up Constructor Body ( 建構式本體上移 )
 - Pull Up Field ( 欄位上移 )
 - Pull Up Method ( 函式上移 )
 - Push Down Field ( 欄位下移 )
 - Push Down Method ( 函式下移 )
 - Remove Assignments to Parameters ( 移除對參數的賦值動作 )
 - Remove Control Flag ( 移除控制旗標 )
 - Remove Middle Man ( 移除中間人 )
 - Remove Parameter ( 移除參數 )
 - Remove Setting Method ( 移除設值函式 )
 - Rename Method ( 重新命名函式 )
 - Replace Array with Object ( 以物件取代陣列 )
 - Replace Conditional with Polymorphism ( 以多型取代條件式 )
 - Replace Constructor with Factory Method ( 以工廠函式取代建構式 )
 - Replace Data Value with Object ( 以物件取代資料值 )
 - Replace Delegation with Inheritance ( 以繼承取代委託 )
 - Replace Error Code with Exception ( 以異常取代錯誤碼 )
 - Replace Exception with Test ( 以測試取代異常 )
 - Replace Inheritance with Delegation ( 以委託取代繼承 )
 - Replace Magic Number with Symbolic Constant ( 以字面常數取代魔術數字 )
 - Replace Method with Method Object ( 以函式物件取代函式 )
 - Replace Nested Conditional with Guard Clauses ( 以衛述句取代巢狀條件式 )
 - Replace Parameter with Explicit Methods ( 以明確函式取代參數 )
 - Replace Parameter with Method ( 以函式取代參數 )
 - Replace Record with Data Class ( 以資料類別取代記錄 )
 - Replace Subclass with Fields ( 以欄位取代子類別 )
 - Replace Temp with Query ( 以查詢取代暫時變數 )
 - Replace Type Code with Class ( 以類別取代型別代碼 )
 - Replace Type Code with State/Strategy ( 以State/Strategy 取代型別代碼 )
 - Replace Type Code with Subclasses ( 以子類別取代型別代碼 )
 - Self Encapsulate Field ( 自我封裝欄位 )
 - Separate Domain from Presentation ( 將領域和表述/顯示分離 )
 - Separate Query from Modifier ( 將查詢函式和修改函式分離 )
 - Split Temporaty Variable ( 剖解暫時變數 )
 - Substitute Algorithm ( 替換你的演算法 )
 - Tease Apart Inheritance ( 梳理並分解繼承體系 )
 
希望未來能有機會,慢慢為每個項目加上Link,並說明我碰到的情況,期許自己更上一層樓。
加油!
沒有留言:
張貼留言
感謝您的留言,如果我的文章你喜歡或對你有幫助,按個「讚」或「分享」它,我會很高興的。