제어의 역전(IoC, Inversion of Control)은 객체의 생성과 생명주기 관리를 개발자가 아닌 프레임워크가 담당하는 디자인 패턴이다.
스프링의 IoC 컨테이너는 스프링 프레임워크의 핵심 기능 중 하나이다. 이 컨테이너는 애플리케이션의 객체들을 생성하고, 구성하며, 관리하는 역할을 한다.
보통 ApplicationContext를 스프링 컨테이너라고 한다.
BeanFactory 의 모든 기능을 포함하고, 추가 기능을 제공MessageSource 인터페이스를 통해 국제화 메시지에 접근ResourceLoader 인터페이스를 통해 접근ApplicationEventPublisher 인터페이스를 사용하여 ApplicationListener 인터페이스를 구현하는 빈에게 이벤트를 발생특별한 이유가 없다면 ApplicationContext를 사용하도록 한다.
ApplicationContext context = new ClassPathXmlApplicationContext("services.xml", "daos.xml");
// 또는
ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
Inversion of Control Containers and the Dependency Injection pattern
The IoC Container :: Spring Framework