[Spring Boot] Dependency Injection and Inversion of Control

brandon·2025년 3월 20일

spring-boot

목록 보기
3/15

Inversion of Control?

  • 객체의 생성, 생명주기, 관리까지 모든 객체에 대한 주도권을 프레임워크가 가진것.

Spring Container?

  • Spring Application 내에서 자바 객체를 관리하는 공간을 뜻한다.
  • 의존성 주입(DI, Dependency Injection)을 통하여 Application을 구성하는 빈(Bean)들의 생명주기(Life Cycle)을 개발자 대신 관리해줌.

BeanFactory

  • Core container: Spring IoC container 의 기본적인 인터페이스
  • Lazy initialization: Bean이 필요할때에 생성된다.

ApplicationContext

  • Eager Initialization (default): 컨테이너가 만들어질때 Bean도 같이 만들어진다.
  • Aspect Oriented Programming: 관점 지향 프로그래밍 - 각 객체들간에 공통된 비즈니스 로직을 주입할 수 있음.
  • BeanFactory의 발전된 컨테이너.
profile
everything happens for a reason

0개의 댓글