@Component

2022. 12. 28. 14:58Spring

@Component 어노테이션을 이용하면 Bean Configuration 파일에 Bean을 따로 등록하지 않아도 사용할 수 있다.

빈 등록자체를 빈 클래스 자체에다가 할 수 있다는 의미이다.

 

@Component 어노테이션은 기본적으로 타입기반의 자동주입 어노테이션이다.

@Autowired, @Resource와 비슷한 기능을 수행한다고 할 수 있겠다.

 

하위 어노테이션으로는 @service @repository등이 있다.

'Spring' 카테고리의 다른 글

@Configuration vs @Component  (0) 2022.12.28
@Configuration  (0) 2022.12.28
@Service  (0) 2022.12.28
@RequestParam  (0) 2022.12.23
@RequestMapping  (0) 2022.12.23