How do you refactor?

前端 未结 14 1236
别那么骄傲
别那么骄傲 2020-12-13 03:06

I was wondering how other developers begin refactoring. What is your first step? How this process (refactoring) differ if you refactor code which is not yours? Do you write

14条回答
  •  天命终不由人
    2020-12-13 03:09

    General approach

    I may start out by peeking at the software (component) from bird-view. Dependency analysis and graphing tools are a great help here (see later sections). I look for a circle in either the package-level or the class-level dependencies, and also alternatively for classes with too many dependencies. These are good candidates for refactoring.

    Tools of the trade

    Dependency analysis tools:

    • Python
    • Java

提交回复
热议问题