Closed minho-jang closed 2 years ago
Reference #61
필드 주입보다 생성자 주입을 사용해야 한다. 단일 생성자인 경우 @Autowired를 삭제할 수 있다.
@Autowired
final
필드 주입보다 생성자 주입을 사용해야 한다. 단일 생성자인 경우
@Autowired
를 삭제할 수 있다.생성자 주입(constructor injection)의 장점
final
로 선언 가능 = 해당 객체는 변경이 불가능한 immutable 상태 유지