Skip to content

Latest commit

ย 

History

History
19 lines (16 loc) ยท 1.2 KB

README.md

File metadata and controls

19 lines (16 loc) ยท 1.2 KB

Container

์ปจํ…Œ์ด๋„ˆ๋ž€ ์ธ์Šคํ„ด์Šค์˜ ์ƒ๋ช…์ฃผ๊ธฐ๋ฅผ ๊ด€๋ฆฌํ•˜๋ฉฐ, ์ƒ์„ฑ๋œ ์ธ์Šคํ„ด์Šค๋“ค์—๊ฒŒ ์ถ”๊ฐ€์ ์ธ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋„๋ก ํ•˜๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.
๊ฐœ๋ฐœ์ž๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ์˜ ์ฒ˜๋ฆฌ ๊ณผ์ •์„ ์œ„์ž„๋ฐ›์€ ๋…๋ฆฝ์ ์ธ ๊ฐ์ฒด๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.
์ ์ ˆํ•œ ์„ค์ •๋งŒ ๋˜์–ด ์žˆ๋‹ค๋ฉด ๋ˆ„๊ตฌ์˜ ๋„์›€ ์—†์ด๋„ ๊ฐœ๋ฐœ์ž๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ๋ฅผ ์Šค์Šค๋กœ ์ฐธ์กฐํ•œ ๋’ค ์•Œ์•„์„œ ๊ฐ์ฒด์˜ ์ƒ์„ฑ๊ณผ ์†Œ๋ฉธ์„ ์ปจํŠธ๋กคํ•ฉ๋‹ˆ๋‹ค.
Spring Framework๋Š” ๋‹ค๋ฅธ ํ”„๋ ˆ์ž„์›Œํฌ๋“ค๊ณผ ๋‹ฌ๋ฆฌ ์ปจํ…Œ์ด๋„ˆ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋Š”๋ฐ, ์ด๋ฅผ ์ œ๊ณต ๊ฐ€๋Šฅํ•˜๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด IoC ํŒจํ„ด์ž…๋‹ˆ๋‹ค.
์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ์—๋Š” BeanFactory, ApplicationContext ์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ’ก Spring Container & Bean
AppConfig ํด๋ž˜์Šค ๊ฐ™์€ ๊ฒƒ์ด ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ๋กœ @Configuration ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
AppConfig ๋‚ด์—์„œ @Bean์ด ๋ถ™์€ ๊ฒƒ์ด Spring Bean์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.
โœ… ApplicationContext
์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ๋กœ, BeanFactory ์ธํ„ฐํŽ˜์ด์Šค์˜ ํ•˜์œ„ ์ธํ„ฐํŽ˜์ด์Šค์••๋‹ˆ๋‹ค.
BeanFactory๋Š” ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ์˜ ์ตœ์ƒ์œ„ ์ธํ„ฐํŽ˜์ด์Šค๋กœ ApplicationContext๋Š” BeanFactory์— ๋ถ€๊ฐ€ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.