컴퓨터/이론 및 tools 사용

리팩토링 refactoring

review777777 2017. 1. 23. 01:40
반응형

블로그에 있는 리팩토링 글 정리

클릭 시 해당 글로 이동

Update 2017.01.30

 

리팩토링 refactoring 이란?

 

 

Composing Methods 메소드구성

- Extract Method

- Inline Method 즉시처리하는 메소드

- Extract Variable

- Inline Temp

- Replace Temp with Query

- Split Temporary Variable

- Remove Assignments to Parameters 매개변수에 대한 할당 제거

- Replace Method with Method Object

- Subsitute Algorithm

 

 

Moving Features between Objects

- Move Method

- Move Field

- Extract Class

- Inline Class

- Hide Delegate

- Remove Middle Man

- Introduce Foreign Method

- Introduce Local Extension

 

 

 

 

Organizing Data

- Self Encapsutate Field

- Replace Data Value with Object

- Change Value to Reference

- Change Reference to Value

- Replace Array with Object

- Duplicate Observed Data

- Change Unidrectional Association to Bidirectional

- Change Bidirectional Association to Unidrectional

- Replace Magic Number with symbolic Constant

- Encapsulate Field

- Encapsulate Collection

- Replace Type Code with Class

- Replace Type Code with Subclasses

- Replace Type Code with State/Strategy

- Replace Subcalss with Fields

 

 

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

- Introduce Assertion

 

 

 

Simplifying Method Calls

- Rename Method

- Add Parameter

- Remove Parameter

- Separate Query from Modifier

- Parameterize Method

- Replace Parameter with Explicit Methods

- Preserve Whole Object

- Replace Parameter with Method Call

- Introduce PArameter Object

- Remove Setting Method

- Hide Method

- Replace Construcotr with Factory Method

- Replace Error Code with Exception

- Replace Exception with Test

 

Dealing with Generalisation

- Pull Up Field

- Pull Up Method

- Pull Up Constructor Body

- Push Down Method

- Push Down Field

- Extract Subclass

- Extract Superclass

- Extract Interface

- Collapse Hierachy

- Form Template Method

- Replace Inheritance with Delegation

- Replace Delegation with Inheritance

 

 

 

 

 

 

반응형