HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
📝
남득윤 학습 저장소
/
Spring Framework
Spring Framework
/
Core
Core
/
🇧🇶
Bean Overview
🇧🇶

Bean Overview

 
스프링 IOC 컨테이너 내부에서 빈 들의 정의는 BeanDefinition 객체로 표현된다. BeanDefinition은 빈의 정의에 대한 metadata를 가진다.
 
The Bean Definition
Property
Description
Class
빈 생성 타입
Name
빈 이름
Scope
빈 스코프
Construtor arguments
TBD
Properties
TBD
Autowiring mode
TBD
Lazy initialization mode
지연 초기화
Initilazation method
빈 생성 후 콜백
Destruction methods
빈 소멸 전 콜백
❕
빈의 정보는 최대한 빨리 스프링 IOC 컨테이너에 등록 되어야한다. 빈을 런타임에 등록하는 방식은 공식적으로 지원되지 않으며 동시적 접근 이슈등을 야기할 수 있다.
 

Naming Beans

모든 Bean은 하나 이상의 identifiers를 가진다. 식별자는 빈을 관리하는 컨테이너 내에서 유일해야한다. 보통 Bean은 하나의 식별자를 가지고 하나 이상인 경우 서로 aliases로 취급한다.
 
Bean에 explicit한 name이나 id를 부여하지 않으면 컨테이너가 자동으로 bean의 이름을 생성한다.
Bean Naming Conventions = standard java convention for instance field names e.g.) accountManager, accountService, userDao, loginController