2017년 8월 9일 수요일

Refactoring Techniques

Refactoring Techniques


.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, substitute algorithm

.Moving Feature between

..move method, move field, extract class, inline class, hide delegate, remove middle man, introduce foreign method, introduce local extension

.Organizing Data

..selfencapsulate field, replace data value with object, change value to reference, change reference to value, replace array with object, duplicate observered data, change unidirectional association to bidirectional, change bidirectional association to unidirectional, 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 subclass with fields

.Simplifying Conditional Expression

..decompose conditional, consolidate conditional expression, consolidate duplicate conditional fragments, remove control flag, replace nested conditional with guard clauses, replace condional with polymorphism, introduce null object, introduce assertion

.Simplifying Method Calls

..rename method, add parameter, remove parameter, seprate 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 constructor with factory method, replace error code with excetpion, replace exception with test

.Dealing with Generalization

..pull up field, pull up method, pull up constructor body, push down method, push down field, extract subclass, extract superclass, extract interface, collapse hierarchy, form template method, replace inheritance with delegation, replace delegation with inferitance


.Big Refactorings(추가)

..Tease Apart Inheritance, Convert Procedural Design to Objects, Separate Domain from Presentation, Extract Hierarchy


reference :
(1) Refactoring techniques
https://refactoring.guru/refactoring/techniques
  Martin Fowler's refactoring 예시로 쓰였던 코드들을 가지고, refactoring techniques를 적용과정을 step by step 확인할 수 있다.
  각각의 technique에 대해 Why, Benefit, How로 정리되어 있으며, 가장 하단에 Live Example로 차근차근 볼 수 있다. (Internet Explorer에서는 안될 수도)


(2) 대규모 리팩토링 (Big Refactorings)
http://wiki.gurubee.net/pages/viewpage.action?pageId=1507354
 구루비에서 한글로 작성된 내용이다. 읽어보진 않았지만 다른 Refactoring technique에 대해서 다루고 있는 것 같다. Big Refactoring에 대한 내용까지 포함하고 있어서 추가했다.


Linux Performance 기초


Netflix Techblog

what do you check in the first minute?

https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55

Tutorials

https://medium.com/netflix-techblog/netflix-at-velocity-2015-linux-performance-tools-51964ddb81cf