본문 바로가기
Backend

[Spring] Spring IoC

by wahu 2020. 2. 17.

IoC (Inversion of Control) 제어권의 역전이다.

 

Bean   

ApplicationContext에서 관리하는 객체

 

빈 등록은 여러가지가 있다.

Annotation으로 등록할 수 있는 방법은 다음과 같다.

 

@Component

@Controller, @Service, @Repositroy

 

빈으로 직접 등록

@Bean Annotaion 활용

 

Component Scanning

@ComponentScan -> 어디부터 component를 찾아봐라를 의미한다.

 

의존성 주입 위치

* 생성자

* 필드

* setter 

 

 

 

 

Question.

Component Scan은 누가 실행할까요?

 

댓글