TOP
0
0
魅麗。花火原創小說66折起
重構:改善既有代碼的設計(簡體書)
滿額折

重構:改善既有代碼的設計(簡體書)

人民幣定價:69 元
定  價:NT$ 414 元
優惠價:87360
缺貨無法訂購
相關商品
商品簡介
目次

商品簡介

本書清晰地揭示了重構的過程,解釋了重構的原理和最佳實踐方式,并給出了何時以及何地應該開始挖掘代碼以求改善。書中給出了70多個可行的重構,每個重構都介紹了一種經過驗證的代碼變換手法的動機和技術。本書提出的重構準則將幫助你一次一小步地修改你的代碼,從而減少了開發過程中的風險。
本書適合軟件開發人員、項目管理人員等閱讀,也可作為高等院校計算機及相關專業師生的參考讀物。

目次

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 用繼承代替委托 
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 索引

您曾經瀏覽過的商品

購物須知

大陸出版品因裝訂品質及貨運條件與台灣出版品落差甚大,除封面破損、內頁脫落等較嚴重的狀態,其餘商品將正常出貨。

特別提醒:部分書籍附贈之內容(如音頻mp3或影片dvd等)已無實體光碟提供,需以QR CODE 連結至當地網站註冊“並通過驗證程序”,方可下載使用。

無現貨庫存之簡體書,將向海外調貨:
海外有庫存之書籍,等候約45個工作天;
海外無庫存之書籍,平均作業時間約60個工作天,然不保證確定可調到貨,尚請見諒。

為了保護您的權益,「三民網路書店」提供會員七日商品鑑賞期(收到商品為起始日)。

若要辦理退貨,請在商品鑑賞期內寄回,且商品必須是全新狀態與完整包裝(商品、附件、發票、隨貨贈品等)否則恕不接受退貨。

優惠價:87 360
缺貨無法訂購

暢銷榜

客服中心

收藏

會員專區