auto commit
This commit is contained in:
parent
be93a81427
commit
cc1daa03cf
|
@ -17,7 +17,7 @@
|
|||
* [1. 索引分类](#1-索引分类)
|
||||
* [1.1 B-Tree 索引](#11-b-tree-索引)
|
||||
* [1.2 哈希索引](#12-哈希索引)
|
||||
* [1.3. 空间索引数据(R-Tree)](#13-空间索引数据(r-tree))
|
||||
* [1.3. 空间索引数据(R-Tree)](#13-空间索引数据r-tree)
|
||||
* [1.4 全文索引](#14-全文索引)
|
||||
* [2. 索引的优点](#2-索引的优点)
|
||||
* [3. 索引优化](#3-索引优化)
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
* [进程状态的切换](#进程状态的切换)
|
||||
* [调度算法](#调度算法)
|
||||
* [1. 批处理系统中的调度](#1-批处理系统中的调度)
|
||||
* [1.1 先来先服务(FCFS)](#11-先来先服务(fcfs))
|
||||
* [1.2 短作业优先(SJF)](#12-短作业优先(sjf))
|
||||
* [1.3 最短剩余时间优先(SRTN)](#13-最短剩余时间优先(srtn))
|
||||
* [1.1 先来先服务(FCFS)](#11-先来先服务fcfs)
|
||||
* [1.2 短作业优先(SJF)](#12-短作业优先sjf)
|
||||
* [1.3 最短剩余时间优先(SRTN)](#13-最短剩余时间优先srtn)
|
||||
* [2. 交互式系统中的调度](#2-交互式系统中的调度)
|
||||
* [2.1 优先权优先](#21-优先权优先)
|
||||
* [2.2 时间片轮转](#22-时间片轮转)
|
||||
|
@ -69,16 +69,16 @@
|
|||
* [3. 段页式](#3-段页式)
|
||||
* [4. 分页与分段区别](#4-分页与分段区别)
|
||||
* [页面置换算法](#页面置换算法)
|
||||
* [1. 最佳(Optimal)](#1-最佳(optimal))
|
||||
* [2. 先进先出(FIFO)](#2-先进先出(fifo))
|
||||
* [3. 最近最久未使用(LRU,Least Recently Used)](#3-最近最久未使用(lru,least-recently-used))
|
||||
* [4. 时钟(Clock)](#4-时钟(clock))
|
||||
* [1. 最佳(Optimal)](#1-最佳optimal)
|
||||
* [2. 先进先出(FIFO)](#2-先进先出fifo)
|
||||
* [3. 最近最久未使用(LRU,Least Recently Used)](#3-最近最久未使用lru,least-recently-used)
|
||||
* [4. 时钟(Clock)](#4-时钟clock)
|
||||
* [第五章 设备管理](#第五章-设备管理)
|
||||
* [磁盘调度算法](#磁盘调度算法)
|
||||
* [1. 先来先服务(FCFS,First Come First Serverd)](#1-先来先服务(fcfs,first-come-first-serverd))
|
||||
* [2. 最短寻道时间优先(SSTF,Shortest Seek Time First)](#2-最短寻道时间优先(sstf,shortest-seek-time-first))
|
||||
* [3. 扫描算法(SCAN)](#3-扫描算法(scan))
|
||||
* [4. 循环扫描算法(CSCAN)](#4-循环扫描算法(cscan))
|
||||
* [1. 先来先服务(FCFS,First Come First Serverd)](#1-先来先服务fcfs,first-come-first-serverd)
|
||||
* [2. 最短寻道时间优先(SSTF,Shortest Seek Time First)](#2-最短寻道时间优先sstf,shortest-seek-time-first)
|
||||
* [3. 扫描算法(SCAN)](#3-扫描算法scan)
|
||||
* [4. 循环扫描算法(CSCAN)](#4-循环扫描算法cscan)
|
||||
* [参考资料](#参考资料)
|
||||
<!-- GFM-TOC -->
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
* [IP 地址编址](#ip-地址编址)
|
||||
* [1. 分类的 IP 地址](#1-分类的-ip-地址)
|
||||
* [2. 划分子网](#2-划分子网)
|
||||
* [3. 无分类编址 CIDR(构成超网)](#3-无分类编址-cidr(构成超网))
|
||||
* [3. 无分类编址 CIDR(构成超网)](#3-无分类编址-cidr构成超网)
|
||||
* [IP 地址和 MAC 地址](#ip-地址和-mac-地址)
|
||||
* [地址解析协议 ARP](#地址解析协议-arp)
|
||||
* [路由器的结构](#路由器的结构)
|
||||
|
|
184
notes/重构.md
184
notes/重构.md
|
@ -1,108 +1,108 @@
|
|||
<!-- GFM-TOC -->
|
||||
* [第一章 重构,第一个案例](#第一章-重构,第一个案例)
|
||||
* [第一章 第一个案例](#第一章-第一个案例)
|
||||
* [第二章 重构原则](#第二章-重构原则)
|
||||
* [第三章 代码的坏味道](#第三章-代码的坏味道)
|
||||
* [1. Duplicated Code(重复代码)](#1-duplicated-code(重复代码))
|
||||
* [2. Long Method(过长函数)](#2-long-method(过长函数))
|
||||
* [3. Large Class(过大的类)](#3-large-class(过大的类))
|
||||
* [4. Long Parameter List(过长的参数列)](#4-long-parameter-list(过长的参数列))
|
||||
* [5. Divergent Change(发散式变化)](#5-divergent-change(发散式变化))
|
||||
* [6. Shotgun Surgery(散弹式修改)](#6-shotgun-surgery(散弹式修改))
|
||||
* [7. Feature Envy(依恋情结)](#7-feature-envy(依恋情结))
|
||||
* [8. Data Clumps(数据泥团)](#8-data-clumps(数据泥团))
|
||||
* [9. Primitive Obsession(基本类型偏执)](#9-primitive-obsession(基本类型偏执))
|
||||
* [10. Switch Statements(switch 惊悚现身)](#10-switch-statements(switch-惊悚现身))
|
||||
* [11. Parallel Inheritance Hierarchies(平行继承体系)](#11-parallel-inheritance-hierarchies(平行继承体系))
|
||||
* [12. Lazy Class(冗余类)](#12-lazy-class(冗余类))
|
||||
* [13. Speculative Generality(夸夸其谈未来性)](#13-speculative-generality(夸夸其谈未来性))
|
||||
* [14. Temporary Field(令人迷惑的暂时字段)](#14-temporary-field(令人迷惑的暂时字段))
|
||||
* [15. Message Chains(过度耦合的消息链)](#15-message-chains(过度耦合的消息链))
|
||||
* [16. Middle Man(中间人)](#16-middle-man(中间人))
|
||||
* [17. Inappropriate Intimacy(狎昵关系)](#17-inappropriate-intimacy(狎昵关系))
|
||||
* [18. Alernative Classes with Different Interfaces(异曲同工的类)](#18-alernative-classes-with-different-interfaces(异曲同工的类))
|
||||
* [19. Incomplete Library Class(不完美的类库)](#19-incomplete-library-class(不完美的类库))
|
||||
* [20. Data Class(幼稚的数据类)](#20-data-class(幼稚的数据类))
|
||||
* [21. Refused Bequest(被拒绝的馈赠)](#21-refused-bequest(被拒绝的馈赠))
|
||||
* [22. Comments(过多的注释)](#22-comments(过多的注释))
|
||||
* [1. Duplicated Code(重复代码)](#1-duplicated-code重复代码)
|
||||
* [2. Long Method(过长函数)](#2-long-method过长函数)
|
||||
* [3. Large Class(过大的类)](#3-large-class过大的类)
|
||||
* [4. Long Parameter List(过长的参数列)](#4-long-parameter-list过长的参数列)
|
||||
* [5. Divergent Change(发散式变化)](#5-divergent-change发散式变化)
|
||||
* [6. Shotgun Surgery(散弹式修改)](#6-shotgun-surgery散弹式修改)
|
||||
* [7. Feature Envy(依恋情结)](#7-feature-envy依恋情结)
|
||||
* [8. Data Clumps(数据泥团)](#8-data-clumps数据泥团)
|
||||
* [9. Primitive Obsession(基本类型偏执)](#9-primitive-obsession基本类型偏执)
|
||||
* [10. Switch Statements(switch 惊悚现身)](#10-switch-statementsswitch-惊悚现身)
|
||||
* [11. Parallel Inheritance Hierarchies(平行继承体系)](#11-parallel-inheritance-hierarchies平行继承体系)
|
||||
* [12. Lazy Class(冗余类)](#12-lazy-class冗余类)
|
||||
* [13. Speculative Generality(夸夸其谈未来性)](#13-speculative-generality夸夸其谈未来性)
|
||||
* [14. Temporary Field(令人迷惑的暂时字段)](#14-temporary-field令人迷惑的暂时字段)
|
||||
* [15. Message Chains(过度耦合的消息链)](#15-message-chains过度耦合的消息链)
|
||||
* [16. Middle Man(中间人)](#16-middle-man中间人)
|
||||
* [17. Inappropriate Intimacy(狎昵关系)](#17-inappropriate-intimacy狎昵关系)
|
||||
* [18. Alernative Classes with Different Interfaces(异曲同工的类)](#18-alernative-classes-with-different-interfaces异曲同工的类)
|
||||
* [19. Incomplete Library Class(不完美的类库)](#19-incomplete-library-class不完美的类库)
|
||||
* [20. Data Class(幼稚的数据类)](#20-data-class幼稚的数据类)
|
||||
* [21. Refused Bequest(被拒绝的馈赠)](#21-refused-bequest被拒绝的馈赠)
|
||||
* [22. Comments(过多的注释)](#22-comments过多的注释)
|
||||
* [第四章 构筑测试体系](#第四章-构筑测试体系)
|
||||
* [第五章 重构列表](#第五章-重构列表)
|
||||
* [第六章 重新组织函数](#第六章-重新组织函数)
|
||||
* [1. Extract Method(提炼函数)](#1-extract-method(提炼函数))
|
||||
* [2. Inline Method(内联函数)](#2-inline-method(内联函数))
|
||||
* [3. Inline Temp(内联临时变量)](#3-inline-temp(内联临时变量))
|
||||
* [4. Replace Temp with Query(以查询取代临时变量)](#4-replace-temp-with-query(以查询取代临时变量))
|
||||
* [5. Introduce Explaining Variable(引起解释变量)](#5-introduce-explaining-variable(引起解释变量))
|
||||
* [6. Split Temporary Variable(分解临时变量)](#6-split-temporary-variable(分解临时变量))
|
||||
* [7. Remove Assigments to Parameters(移除对参数的赋值)](#7-remove-assigments-to-parameters(移除对参数的赋值))
|
||||
* [8. Replace Method with Method Object(以函数对象取代函数)](#8-replace-method-with-method-object(以函数对象取代函数))
|
||||
* [9. Subsititute Algorithn(替换算法)](#9-subsititute-algorithn(替换算法))
|
||||
* [1. Extract Method(提炼函数)](#1-extract-method提炼函数)
|
||||
* [2. Inline Method(内联函数)](#2-inline-method内联函数)
|
||||
* [3. Inline Temp(内联临时变量)](#3-inline-temp内联临时变量)
|
||||
* [4. Replace Temp with Query(以查询取代临时变量)](#4-replace-temp-with-query以查询取代临时变量)
|
||||
* [5. Introduce Explaining Variable(引起解释变量)](#5-introduce-explaining-variable引起解释变量)
|
||||
* [6. Split Temporary Variable(分解临时变量)](#6-split-temporary-variable分解临时变量)
|
||||
* [7. Remove Assigments to Parameters(移除对参数的赋值)](#7-remove-assigments-to-parameters移除对参数的赋值)
|
||||
* [8. Replace Method with Method Object(以函数对象取代函数)](#8-replace-method-with-method-object以函数对象取代函数)
|
||||
* [9. Subsititute Algorithn(替换算法)](#9-subsititute-algorithn替换算法)
|
||||
* [第七章 在对象之间搬移特性](#第七章-在对象之间搬移特性)
|
||||
* [1. Move Method(搬移函数)](#1-move-method(搬移函数))
|
||||
* [2. Move Field(搬移字段)](#2-move-field(搬移字段))
|
||||
* [3. Extract Class(提炼类)](#3-extract-class(提炼类))
|
||||
* [4. Inline Class(将类内联化)](#4-inline-class(将类内联化))
|
||||
* [5. Hide Delegate(隐藏“委托关系”)](#5-hide-delegate(隐藏“委托关系”))
|
||||
* [6. Remove Middle Man(移除中间人)](#6-remove-middle-man(移除中间人))
|
||||
* [7. Introduce Foreign Method(引入外加函数)](#7-introduce-foreign-method(引入外加函数))
|
||||
* [8. Introduce Local Extension(引入本地扩展)](#8-introduce-local-extension(引入本地扩展))
|
||||
* [1. Move Method(搬移函数)](#1-move-method搬移函数)
|
||||
* [2. Move Field(搬移字段)](#2-move-field搬移字段)
|
||||
* [3. Extract Class(提炼类)](#3-extract-class提炼类)
|
||||
* [4. Inline Class(将类内联化)](#4-inline-class将类内联化)
|
||||
* [5. Hide Delegate(隐藏“委托关系”)](#5-hide-delegate隐藏“委托关系”)
|
||||
* [6. Remove Middle Man(移除中间人)](#6-remove-middle-man移除中间人)
|
||||
* [7. Introduce Foreign Method(引入外加函数)](#7-introduce-foreign-method引入外加函数)
|
||||
* [8. Introduce Local Extension(引入本地扩展)](#8-introduce-local-extension引入本地扩展)
|
||||
* [第八章 重新组织数据](#第八章-重新组织数据)
|
||||
* [1. Self Encapsulate Field(自封装字段)](#1-self-encapsulate-field(自封装字段))
|
||||
* [2. Replace Data Value with Object(以对象取代数据值)](#2-replace-data-value-with-object(以对象取代数据值))
|
||||
* [3. Change Value to Reference(将值对象改成引用对象)](#3-change-value-to-reference(将值对象改成引用对象))
|
||||
* [4. Change Reference to value(将引用对象改为值对象)](#4-change-reference-to-value(将引用对象改为值对象))
|
||||
* [5. Replace Array with Object(以对象取代数组)](#5-replace-array-with-object(以对象取代数组))
|
||||
* [6. Duplicate Observed Data(赋值“被监视数据”)](#6-duplicate-observed-data(赋值“被监视数据”))
|
||||
* [7. Change Unidirectional Association to Bidirectional(将单向关联改为双向关联)](#7-change-unidirectional-association-to-bidirectional(将单向关联改为双向关联))
|
||||
* [8. Change Bidirectional Association to Unidirectional(将双向关联改为单向关联)](#8-change-bidirectional-association-to-unidirectional(将双向关联改为单向关联))
|
||||
* [9. Replace Magic Number with Symbolic Constant(以字面常量取代魔法数)](#9-replace-magic-number-with-symbolic-constant(以字面常量取代魔法数))
|
||||
* [10. Encapsulate Field(封装字段)](#10-encapsulate-field(封装字段))
|
||||
* [11. Encapsulate Collection(封装集合)](#11-encapsulate-collection(封装集合))
|
||||
* [12. Replace Record with Data Class(以数据类取代记录)](#12-replace-record-with-data-class(以数据类取代记录))
|
||||
* [13. Replace Type Code with Class(以类取代类型码)](#13-replace-type-code-with-class(以类取代类型码))
|
||||
* [14. Replace Type Code with Subcalsses(以子类取代类型码)](#14-replace-type-code-with-subcalsses(以子类取代类型码))
|
||||
* [15. Replace Type Code with State/Strategy (以 State/Strategy 取代类型码)](#15-replace-type-code-with-statestrategy-(以-statestrategy-取代类型码))
|
||||
* [16. Replace Subclass with Fields(以字段取代子类)](#16-replace-subclass-with-fields(以字段取代子类))
|
||||
* [1. Self Encapsulate Field(自封装字段)](#1-self-encapsulate-field自封装字段)
|
||||
* [2. Replace Data Value with Object(以对象取代数据值)](#2-replace-data-value-with-object以对象取代数据值)
|
||||
* [3. Change Value to Reference(将值对象改成引用对象)](#3-change-value-to-reference将值对象改成引用对象)
|
||||
* [4. Change Reference to value(将引用对象改为值对象)](#4-change-reference-to-value将引用对象改为值对象)
|
||||
* [5. Replace Array with Object(以对象取代数组)](#5-replace-array-with-object以对象取代数组)
|
||||
* [6. Duplicate Observed Data(赋值“被监视数据”)](#6-duplicate-observed-data赋值“被监视数据”)
|
||||
* [7. Change Unidirectional Association to Bidirectional(将单向关联改为双向关联)](#7-change-unidirectional-association-to-bidirectional将单向关联改为双向关联)
|
||||
* [8. Change Bidirectional Association to Unidirectional(将双向关联改为单向关联)](#8-change-bidirectional-association-to-unidirectional将双向关联改为单向关联)
|
||||
* [9. Replace Magic Number with Symbolic Constant(以字面常量取代魔法数)](#9-replace-magic-number-with-symbolic-constant以字面常量取代魔法数)
|
||||
* [10. Encapsulate Field(封装字段)](#10-encapsulate-field封装字段)
|
||||
* [11. Encapsulate Collection(封装集合)](#11-encapsulate-collection封装集合)
|
||||
* [12. Replace Record with Data Class(以数据类取代记录)](#12-replace-record-with-data-class以数据类取代记录)
|
||||
* [13. Replace Type Code with Class(以类取代类型码)](#13-replace-type-code-with-class以类取代类型码)
|
||||
* [14. Replace Type Code with Subcalsses(以子类取代类型码)](#14-replace-type-code-with-subcalsses以子类取代类型码)
|
||||
* [15. Replace Type Code with State/Strategy (以 State/Strategy 取代类型码)](#15-replace-type-code-with-statestrategy-以-statestrategy-取代类型码)
|
||||
* [16. Replace Subclass with Fields(以字段取代子类)](#16-replace-subclass-with-fields以字段取代子类)
|
||||
* [第九章 简化条件表达式](#第九章-简化条件表达式)
|
||||
* [1. Decompose Conditional(分解条件表达式)](#1-decompose-conditional(分解条件表达式))
|
||||
* [2. Consolidate Conditional Expression(合并条件表达式)](#2-consolidate-conditional-expression(合并条件表达式))
|
||||
* [3. Consolidate Duplicate Conditional Fragments (合并重复的条件片段)](#3-consolidate-duplicate-conditional-fragments-(合并重复的条件片段))
|
||||
* [4. Remove Control Flag(移除控制标记)](#4-remove-control-flag(移除控制标记))
|
||||
* [5. Replace Nested Conditional with Guard Clauses (以卫语句取代嵌套条件表达式)](#5-replace-nested-conditional-with-guard-clauses-(以卫语句取代嵌套条件表达式))
|
||||
* [6. Replace Conditional with Polymorphism (以多态取代条件表达式)](#6-replace-conditional-with-polymorphism-(以多态取代条件表达式))
|
||||
* [7. Introduce Null Object(引入Null对象)](#7-introduce-null-object(引入null对象))
|
||||
* [8. Introduce Assertion(引入断言)](#8-introduce-assertion(引入断言))
|
||||
* [1. Decompose Conditional(分解条件表达式)](#1-decompose-conditional分解条件表达式)
|
||||
* [2. Consolidate Conditional Expression(合并条件表达式)](#2-consolidate-conditional-expression合并条件表达式)
|
||||
* [3. Consolidate Duplicate Conditional Fragments (合并重复的条件片段)](#3-consolidate-duplicate-conditional-fragments-合并重复的条件片段)
|
||||
* [4. Remove Control Flag(移除控制标记)](#4-remove-control-flag移除控制标记)
|
||||
* [5. Replace Nested Conditional with Guard Clauses (以卫语句取代嵌套条件表达式)](#5-replace-nested-conditional-with-guard-clauses-以卫语句取代嵌套条件表达式)
|
||||
* [6. Replace Conditional with Polymorphism (以多态取代条件表达式)](#6-replace-conditional-with-polymorphism-以多态取代条件表达式)
|
||||
* [7. Introduce Null Object(引入Null对象)](#7-introduce-null-object引入null对象)
|
||||
* [8. Introduce Assertion(引入断言)](#8-introduce-assertion引入断言)
|
||||
* [第十章 简化函数调用](#第十章-简化函数调用)
|
||||
* [1. Rename Method(函数改名)](#1-rename-method(函数改名))
|
||||
* [2. Add Parameter(添加参数)](#2-add-parameter(添加参数))
|
||||
* [3. Remove Parameter(移除参数)](#3-remove-parameter(移除参数))
|
||||
* [4. Separate Query from Modifier(将查询函数和修改函数分离)](#4-separate-query-from-modifier(将查询函数和修改函数分离))
|
||||
* [5. Parameterize Method(令函数携带参数)](#5-parameterize-method(令函数携带参数))
|
||||
* [6. Replace Parameter with Explicit Methods(以明确函数取代参数)](#6-replace-parameter-with-explicit-methods(以明确函数取代参数))
|
||||
* [7. Preserve Whole Object(保持对象完整)](#7-preserve-whole-object(保持对象完整))
|
||||
* [8. Replace Parameter with Methods(以函数取代参数)](#8-replace-parameter-with-methods(以函数取代参数))
|
||||
* [9. Introduce Parameter Object(引入参数对象)](#9-introduce-parameter-object(引入参数对象))
|
||||
* [10. Remove Setting Method(移除设值函数)](#10-remove-setting-method(移除设值函数))
|
||||
* [11. Hide Method(隐藏函数)](#11-hide-method(隐藏函数))
|
||||
* [12. Replace Constructor with Factory Method (以工厂函数取代构造函数)](#12-replace-constructor-with-factory-method-(以工厂函数取代构造函数))
|
||||
* [13. Encapsulate Downcast(封装向下转型)](#13-encapsulate-downcast(封装向下转型))
|
||||
* [14. Replace Error Code with Exception (以异常取代错误码)](#14-replace-error-code-with-exception-(以异常取代错误码))
|
||||
* [15. Replace Exception with Test(以测试取代异常)](#15-replace-exception-with-test(以测试取代异常))
|
||||
* [1. Rename Method(函数改名)](#1-rename-method函数改名)
|
||||
* [2. Add Parameter(添加参数)](#2-add-parameter添加参数)
|
||||
* [3. Remove Parameter(移除参数)](#3-remove-parameter移除参数)
|
||||
* [4. Separate Query from Modifier(将查询函数和修改函数分离)](#4-separate-query-from-modifier将查询函数和修改函数分离)
|
||||
* [5. Parameterize Method(令函数携带参数)](#5-parameterize-method令函数携带参数)
|
||||
* [6. Replace Parameter with Explicit Methods(以明确函数取代参数)](#6-replace-parameter-with-explicit-methods以明确函数取代参数)
|
||||
* [7. Preserve Whole Object(保持对象完整)](#7-preserve-whole-object保持对象完整)
|
||||
* [8. Replace Parameter with Methods(以函数取代参数)](#8-replace-parameter-with-methods以函数取代参数)
|
||||
* [9. Introduce Parameter Object(引入参数对象)](#9-introduce-parameter-object引入参数对象)
|
||||
* [10. Remove Setting Method(移除设值函数)](#10-remove-setting-method移除设值函数)
|
||||
* [11. Hide Method(隐藏函数)](#11-hide-method隐藏函数)
|
||||
* [12. Replace Constructor with Factory Method (以工厂函数取代构造函数)](#12-replace-constructor-with-factory-method-以工厂函数取代构造函数)
|
||||
* [13. Encapsulate Downcast(封装向下转型)](#13-encapsulate-downcast封装向下转型)
|
||||
* [14. Replace Error Code with Exception (以异常取代错误码)](#14-replace-error-code-with-exception-以异常取代错误码)
|
||||
* [15. Replace Exception with Test(以测试取代异常)](#15-replace-exception-with-test以测试取代异常)
|
||||
* [第十一章 处理概括关系](#第十一章-处理概括关系)
|
||||
* [1. Pull Up Field(字段上移)](#1-pull-up-field(字段上移))
|
||||
* [2. Pull Up Method(函数上移)](#2-pull-up-method(函数上移))
|
||||
* [3. Pull Up Constructor Body(构造函数本体上移)](#3-pull-up-constructor-body(构造函数本体上移))
|
||||
* [4. Push Down Method(函数下移)](#4-push-down-method(函数下移))
|
||||
* [5. Push Down Field(字段下移)](#5-push-down-field(字段下移))
|
||||
* [6. Extract Subclass(提炼子类)](#6-extract-subclass(提炼子类))
|
||||
* [7. Extract Superclass(提炼超类)](#7-extract-superclass(提炼超类))
|
||||
* [8. Extract Interface(提炼接口)](#8-extract-interface(提炼接口))
|
||||
* [9. Collapse Hierarchy(折叠继承体系)](#9-collapse-hierarchy(折叠继承体系))
|
||||
* [10. Form Template Method(塑造模板函数)](#10-form-template-method(塑造模板函数))
|
||||
* [11. Replace Inheritance with Delegation (以委托取代继承)](#11-replace-inheritance-with-delegation-(以委托取代继承))
|
||||
* [12. Replace Delegation with Inheritance (以继承取代委托)](#12-replace-delegation-with-inheritance-(以继承取代委托))
|
||||
* [1. Pull Up Field(字段上移)](#1-pull-up-field字段上移)
|
||||
* [2. Pull Up Method(函数上移)](#2-pull-up-method函数上移)
|
||||
* [3. Pull Up Constructor Body(构造函数本体上移)](#3-pull-up-constructor-body构造函数本体上移)
|
||||
* [4. Push Down Method(函数下移)](#4-push-down-method函数下移)
|
||||
* [5. Push Down Field(字段下移)](#5-push-down-field字段下移)
|
||||
* [6. Extract Subclass(提炼子类)](#6-extract-subclass提炼子类)
|
||||
* [7. Extract Superclass(提炼超类)](#7-extract-superclass提炼超类)
|
||||
* [8. Extract Interface(提炼接口)](#8-extract-interface提炼接口)
|
||||
* [9. Collapse Hierarchy(折叠继承体系)](#9-collapse-hierarchy折叠继承体系)
|
||||
* [10. Form Template Method(塑造模板函数)](#10-form-template-method塑造模板函数)
|
||||
* [11. Replace Inheritance with Delegation (以委托取代继承)](#11-replace-inheritance-with-delegation-以委托取代继承)
|
||||
* [12. Replace Delegation with Inheritance (以继承取代委托)](#12-replace-delegation-with-inheritance-以继承取代委托)
|
||||
<!-- GFM-TOC -->
|
||||
|
||||
# 第一章 重构,第一个案例
|
||||
# 第一章 第一个案例
|
||||
|
||||
如果你发现自己需要为程序添加一个特性,而代码结构使你无法很方便地达成目的,那就先重构这个程序。
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user