其他分享
首页 > 其他分享> > 24.重构

24.重构

作者:互联网

Reasons to refactor:

  1. code is duplicated;
  2. A routine is too long; A routine has a poor name;
  3. A loop is too long or too deeply nested;
  4. A class has poor cohesion; A class interface does not provide a consistent level of abstraction; One class is overly intimate with another;
  5. A parameter list has too many parameters;
  6. Data members are public;
  7. Global variables are used;

Refactorings:

  1. Data-level refactoring;
  2. statement-level refactoring;
  3. routine-level refactoring;
  4. class implementation refactoring;
  5. class interface refactoring;
  6. system-level refactoring.

TIPS:

标签:24,重构,level,replace,refactoring,too,routine,class
来源: https://blog.csdn.net/qq_40732962/article/details/112061983