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

Spring/Spring Quick Start

์Šคํ”„๋ง ์˜์กด์„ฑ ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•

  • Dependency Lookup: ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์ƒ์„ฑํ•œ ๊ฐ์ฒด๋ฅผ ๊ฒ€์ƒ‰(Lookup)ํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹

  • Dependency Injection: ๊ฐ์ฒด ์‚ฌ์ด์˜ ์˜์กด ๊ด€๊ณ„๋ฅผ ์Šคํ”„๋ง ์„ค์ • ํŒŒ์ผ์— ๋“ฑ๋ก๋œ ์ •๋ณด๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์ž๋™์œผ๋กœ ์ฒ˜๋ฆฌํ•ด์ฃผ๋Š” ๋ฐฉ์‹. ๋Œ€๋ถ€๋ถ„ ์ด ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•œ๋‹ค.

    • Constructor Injection: ์ƒ์„ฑ์ž ๊ธฐ๋ฐ˜

    • Setter Injection: Setter ๋ฉ”์†Œ๋“œ ๊ธฐ๋ฐ˜

 

์ฐธ๊ณ ๋กœ, ์˜์กด์„ฑ ๊ด€๊ณ„๋ž€ ๊ฐ์ฒด์™€ ๊ฐ์ฒด์˜ ๊ฒฐํ•ฉ ๊ด€๊ณ„๋ฅผ ๋งํ•œ๋‹ค.

ํด๋ž˜์Šค ๋‹ค์ด์–ด๊ทธ๋žจ์œผ๋กœ ์ด ๊ด€๊ณ„๋ฅผ ์‰ฝ๊ฒŒ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 

๋‹ค์Œ  ํฌ์ŠคํŒ…์—์„œ ๊ฐ ์˜์กด์„ฑ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์ž์„ธํžˆ ๋‹ค๋ค„๋ณผ ๊ฒƒ์ด๋‹ค.