개발관련
-
[Spring]스프링 컨테이너와 스프링 빈개발관련 2023. 5. 29. 20:55
1. 스프링 컨테이너의 생성, 의존성 주입 스프링 컨테이너란, 내부의 객체들 간의 의존관계를 구성,관리하는 저장소로, 스프링에서 제공하는 대표적인 기능이다. 아래는 스프링 컨테이너를 생성하고 동적 의존성을 구입하는 과정을 살펴보자. //1 ApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class); //2 OrderService orderService = applicationContext.getBean("orderService", OrderService.class); MemberService memberService = applicationContext.getBean("memberService..