๐Ÿ’ Spring

๐Ÿ’ Spring/Spring ํ•ต์‹ฌ ๊ธฐ์ˆ 

๋นˆ (Bean) , IoC (Inversion of Control) ์ปจํ…Œ์ด๋„ˆ, @Autowired

IoC ์ปจํ…Œ์ด๋„ˆ - ApplicationContext ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ๊ด€๋ฆฌํ•˜๋Š” ๊ฐ์ฒด๋ฅผ ๋นˆ(bean)์ด๋ผ๊ณ  ํ•˜๊ณ , ์ด ๋นˆ(bean)๋“ค์„ ๊ด€๋ฆฌํ•œ๋‹ค๋Š” ์˜๋ฏธ๋กœ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋นˆ ํŒฉํ† ๋ฆฌ(BeanFactory) ๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค. BeanFactory์— ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ์ปจํ…Œ์ด๋„ˆ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ปจํ…์Šค(ApplicationContext)๋ผ๊ณ  ๋ถ€๋ฆ„ ApplcationContext : ์–˜๊ฐ€ Bean๋“ค์„ ๋งŒ๋“ค๊ณ , ๊ทธ Bean๋“ค์˜ ์˜์กด์„ฑ์„ ์—ฎ์–ด์ค€๋‹ค. ์˜ค๋กœ์ง€ Bean๋“ค๋งŒ ๊ด€๋ฆฌ! OwnerController ๊ฐ€ IoC ์ปจํ…Œ์ด๋„ˆ ๋‚ด๋ถ€์— ๋“ค์–ด์˜ค๊ณ , ์ปจํ…Œ์ด๋„ˆ์—์„œ OwnerController ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค์–ด ์ค€๋‹ค. ๊ทธ๋ฆฌ๊ณ , OwnerRepository ์˜ ๊ฐ์ฒด๋„ ๋งŒ๋“ค์–ด ์ค€๋‹ค. -> Bean ์ฆ‰, Bean๋“ค์˜ ์˜์กด์„ฑ๋“ค์„ ์ž๋™์œผ๋กœ ๊ด€๋ฆฌํ•ด์ค€๋‹ค. I..

iseunghan
'๐Ÿ’ Spring' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (14 Page)