smelles and refactoring
来源:互联网 发布:铃木拡树 知乎 编辑:程序博客网 时间:2024/05/18 01:38
整理了一下,有助于对代码进行refatoring。
Smells Within Classes
| smells | refactoring |
| Comments | |
| Long Method | Extract Method. |
| Large Class | Extract Class Extract Subclass |
| Long Parameter List | Replace Parameter with Method Preserve Whole Object Introduce Parameter Object. |
| | |
Smells Between Classes
Smells category | smells | refactoring |
Data | | |
| Primitive Obsession | Replace Data Value with Object Replace Type Code with Class Replace Type Code with Subclasses Replace Type Code with State/Strategy. |
| Data Class | |
| Data Clump | Extract Class Introduce Parameter Object Preserve Whole Object |
| Temporary Field | Extract Class Introduce Null Object |
Inheritance | | |
| Refused Bequest | Push Down Method Push Down Field Replace Inheritance with Delegation |
| Inappropriate Intimacy (Subclass Form) | Self Encapsulate Field Form Template Method Replace Inheritance with Delegation |
| Lazy Class | Collapse Hierarchy Inline Class |
Responsibility | | |
| Feature Envy | Move Method |
| Inappropriate Intimacy (General Form) | Move Method and Move Field Extract Class and Hide Delegate Change Bidirectional Association to Unidirectional |
| Message Chains | Extract Method Move Method Hide Delegate |
| Middle Man | Remove Middle Man Replace Delegation with Inheritance |
Accommodating Change | | |
| Divergent Change | |
| Shotgun Surgery | |
| Parallel Inheritance Hierarchies | |
| Combinatorial Explosion | |
Library Classes | | |
| Incomplete Library Class | |
| | |
- smelles and refactoring
- Optimizing and Refactoring POMs
- Feature And Refactoring
- [Java] Coding Rules and Refactoring
- Refactoring
- Refactoring
- Refactoring
- Refactoring
- Learing Maven 3 - Optimizing and Refactoring POMs
- AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis
- AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis (目录)
- CLLocation Coordinate 3D refactoring thoughts and examples.
- What Refactoring is, and what it isn’t
- Refactoring Notes-Refactoring Methods
- Refactoring HiMock
- Refactoring practice
- About Refactoring
- Refactoring Workbook
- Transact_SQL小手册
- 任意大小分配的内存池实现
- 强大的代码编档工具—Doxygen
- Sql Server基本函数
- 给微软的IEWebControls加上强名称
- smelles and refactoring
- 极限编程与敏捷开发
- transaction in dot net
- DataGrid超级链接列中绑定一个以上字段
- The difference between Server.Transfer and Response.Redirect
- How to distinguish a human and a robot in the future?
- 在应用中加入全文检索功能—基于Java的全文索引引擎Lucene简介(收藏)
- 在windows 2000,XP 下通过mod_jk2.so整合Tomcat5.0 和 Apache2.0
- Java语言编码规范(Java Code Conventions)