[Refactoring] 클래스 인라인


[Refactoring] 클래스 인라인

클래스 추출하기와 반대에 해당하는 리팩토링 리팩토링을 하는 중에 클래스의 책임을 옮기다 보면 클래스의 존재 이유가 빈약해지는 경우가 발생할 수 있다. 두 개의 클래스를 여러 클래스로 나누는 리팩토링의 경우, 우선 클래스 인라인을 적용해서 두 클래스의 코드를 한곳으로 모으고 그런 다음에 클래스 추출하기를 적용해서 새롭게 분리하는 리팩토링을 적용할 수 있다. 클래스 인라인 음.. 이 부분 예제는 어차피 합치는 거나 다름없다. package me.whiteship.refactoring._08_shotgun_surgery._29_inline_class; public class Shipment { private TrackingInformation trackingInformation; public Shipment(TrackingInformation trackingInformation) { this.trackingInformation = trackingInformation; } public Tr...


#리팩토링 #백기선 #인라인 #인프런 #자바 #함수인라인

원문링크 : [Refactoring] 클래스 인라인