๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ2

Spring - ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ์— ๋“ฑ๋ก๋œ ๋ชจ๋“  ๋นˆ ์กฐํšŒ //ApplicationContextInfoTest.java package hello.core.beanfind; import hello.core.AppConfig; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.AnnotationConfigApplicationContext; class ApplicationContextInfoTest { AnnotationConfigApplicationContext ac = new Anno.. 2023. 7. 9.
Spring - ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ ์ƒ์„ฑ //์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ ์ƒ์„ฑ ApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class); ApplicationContext๋Š” ์Šคํ”„๋ง ์ปจํ„ฐ์ด๋„ˆ์ด์ž, ์ธํ„ฐํŽ˜์ด์Šค์ด๋‹ค. ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ๋Š” XML์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๊ณ , ์• ๋…ธํ…Œ์ด์…˜ ๊ธฐ๋ฐ˜์˜ ์ž๋ฐ” ์„ค์ • ํด๋ž˜์Šค๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค. ์ฐธ๊ณ : ๋” ์ •ํ™•ํžˆ๋Š” ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋ถ€๋ฅผ ๋•Œ BeanFactory , ApplicationContext ๋กœ ๊ตฌ๋ถ„ํ•ด์„œ ์ด์•ผ๊ธฐํ•œ๋‹ค. BeanFactory ๋ฅผ ์ง์ ‘ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๋Š” ๊ฑฐ์˜ ์—†์œผ๋ฏ€๋กœ ์ผ๋ฐ˜์ ์œผ๋กœ ApplicationContext ๋ฅผ ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ๋ผ ํ•œ๋‹ค. 1. ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ ์ƒ์„ฑ new AnnotationConfigAppl.. 2023. 7. 9.