인프런 커뮤니티 질문&답변
클래스 필드에서도 Map @Autowired를 사용할 수 있나요?
작성
·
431
퀴즈
What are the main reasons why Field Injection is generally not recommended?
Because it is difficult to guarantee immutability
Because changing dependencies is easy
Because it's difficult to test with pure Java code
Because writing configuration code is complex
답변 2
0








아무래도 그래서 그런 거 같습니다
생성자에서는
policyMap과policies만 주입 받다보니 저 시점에는null이 나오는 것이 당연해보이고그 이후에 필드 부분에 대한 주입이 이루어지는 거 같네요