IOC
-
[spring] 의존성 주입 (DI) _ 어노테이션 없이 xml로 설정 (생성자, 수정자)Spring 2024. 7. 31. 19:17
HTML 삽입미리보기할 수 없는 소스 모든 객체지향 프로그래밍에 통용되는 개념이다. java를 배우기 때문에 spring을 기준으로 정리한다.✔ 의존성 주입 (Dependency Injection)✨ IoC(Inversion of Control) 의존성 주입을 얘기하기 전에 먼저 알고 가야 하는 개념이 있는데, 바로 IoC이다. 흔히 제어의 역전이라고 말한다. 의미는 번역 그대로 메소드나 객체의 호출 작업을 개발자가 결정하는 것 아니라 외부에서 결정하는 것을 의미한다. Spring에서 ApplicationContext는 IoC 컨테이너를 의미한다. 스프링 프레임워크를 예로 들면, Controller 같은 객체들의 동작 구현은 개발자가 하지만 해당 객체들이 어느 시점에 호출할지는 프레임워크가 제어한다. 개..