강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

비가싫어요님의 프로필 이미지
비가싫어요

작성한 질문수

스프링 핵심 원리 - 기본편

조회한 빈이 모두 필요할 때, List, Map

static class에 @Component 혹은 @Configuration을 생략하는 이유가 무엇인가요?

작성

·

596

0

static class DiscountService를 만들고 이걸 스프링 컨테이너에 빈을 등록하는 과정에서 DiscountService 클래스에@Component나 @Configuration이 없는데도 어떻게 스프링 컨테이너에 등록이 되는 것인지 궁금합니다.

퀴즈

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

답변 1

1

안녕하세요. JUNN님, 공식 서포터즈 OMG입니다.

아래 링크를 참고해주세요.

스프링 컨테이너에 직접 빈으로 등록한 것으로 보시면 될 것 같습니다 :)

https://www.inflearn.com/questions/142543
감사합니다.

비가싫어요님의 프로필 이미지
비가싫어요

작성한 질문수

질문하기