header-img
Info :
728x90

1. ์Šคํ”„๋ง(Spring)

- Java Platform ์„ ์œ„ํ•œ ์˜คํ”ˆ์†Œ์Šค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋ ˆ์ž„์–ดํฌ

- ๋™์ ์ธ ์›น ์‚ฌ์ดํŠธ๋ฅผ ๊ฐœ๋ฐœํ•˜๊ธฐ ์œ„ํ•œ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์„œ๋น„์Šค ์ œ๊ณต

- ์ „์ž ์ •๋ถ€ ํ‘œ์ค€ ํ”„๋ ˆ์ž„์›Œํฌ ๊ธฐ๋ฐ˜ ๊ธฐ์ˆ ๋กœ ์‚ฌ์šฉ

- ํŠน์ง•: ๊ฒฝ๋Ÿ‰ ์ปจํ…Œ์ด๋„ˆ, IoC(Invertion of Control: ์ œ์–ด ์—ญํ–‰), Di(Dependency Injection: ์˜์กด์„ฑ ์ฃผ์ž…), AOP(Aspect-Oriented Programming: ๊ด€์ ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ)

 

2. ์Šคํ”„๋ง ๋ถ€ํŠธ(Spring Boot)

SpringBoot makes it easy(์‰ฝ๊ฒŒ ๋งŒ๋“ ๋‹ค), to create stand-alone(๋‹จ๋…์ ์ธ), production-grade(์ƒ์šฉํ™” ์ˆ˜์ค€์˜) Spring based Applications(์Šคํ”„๋ง ๊ธฐ๋ฐ˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜) that you can "just run"

 

- ์Šคํ”„๋ง ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ์„ค์ •์˜ ๋งŽ์€ ๋ถ€๋ถ„์„ ์ž๋™ํ™”ํ•˜์—ฌ ์‚ฌ์šฉ์ž๊ฐ€ ํŽธ๋ฆฌํ•˜๊ฒŒ ์Šคํ”„๋ง์„ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ๋„์›€

- SpringBoot Starter Dependency ๋งŒ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋ฐ”๋กœ API๋ฅผ ์ •์˜ํ•˜๊ณ , ๋‚ด์žฅ๋œ Tomcat ์ด๋‚˜ Jetty๋กœ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Œ

- ๋” ๋‚˜์•„๊ฐ€ ์Šคํ”„๋ง ํ™ˆํŽ˜์ด์ง€์˜ initializer ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฐ”๋กœ ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ์ฝ”๋“œ๋„ ๋งŒ๋“ค์–ด์คŒ

 

3. Spring vs. Spring Boot

  spring springboot
Dependency
์˜์กด์„ฑ
์„ค์ • ํ•ด์ฃผ์–ด์•ผ ํ•  dependency๊ฐ€ ๋งŽ๊ณ , ๋ชจ๋“  denpendency ๋ฅผ ๋ฒ„์ „๊นŒ์ง€ ๋ช…ํ™•ํ•˜๊ฒŒ ๋ช…์‹œํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค. ๋น„๊ต์  dependency๊ฐ€ ์งง์•„์ง€๊ณ , ๋ฒ„์ „ ๊ด€๋ฆฌ๋„ ๊ถŒ์žฅ ๋ฒ„์ „์œผ๋กœ ์ž๋™ ์„ค์ •์ด ๋œ๋‹ค.
starter์„ ํ†ตํ•œ dependency ์ž๋™ํ™”
Configuration
์„ค์ •
์„ค์ •ํ•ด์ฃผ์–ด์•ผ ํ•  ๊ฒƒ๋“ค ๋งŽ์Œ. anotation ์„ค์ •, ๋นˆ๋„ ์„ค์ • ...
thymeleaf ๋˜ํ•œ ์—ฌ๋Ÿฌ ์„ค์ •์„ ํ•ด์ฃผ์–ด์•ผ ํ•จ.
application.properties (application.yml) ๋•๋ถ„์— config ์„ค์ •์„ ๊ฑฐ์˜ ์•ˆํ•ด์ค˜๋„ ๋œ๋‹ค.
thymeleaf ํ•œ์ค„์ด๋ฉด ๋๋‚จ.
embedded server
๋‚ด์žฅ ์„œ๋ฒ„
  tomcat ์„œ๋ฒ„ ๊ตฌ๋™ ์‹œ๊ฐ„์ด ์ ˆ๋ฐ˜ ๊ฐ€๊นŒ์ด ๋‹จ์ถ•๋จ
tomcat ์ด ์‹ซ์œผ๋ฉด jetty๋กœ ์‚ฌ์šฉ๋„ ๊ฐ€๋Šฅ.
* ๋‚ด์žฅ ์„œ๋ธ”๋ฆฟ ์ปจํ…Œ์ด๋„ˆ ๋•๋ถ„์— jar ํŒŒ์ผ๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋ฐฐํฌ ๊ฐ€๋Šฅ
( java -jar $REPOSITORY/$JAR_NAME & )
๊ธฐํƒ€   ์Šคํ”„๋ง Security, Data JPA ๋“ฑ์˜ ๋‹ค๋ฅธ ์Šคํ”„๋ง ํ”„๋ ˆ์ž„์›Œํฌ ์š”์†Œ๋ฅผ ์‰ฝ๊ฒŒ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค.

* yaml : YAML Ain't Markup Language ์˜ ์ค„์ž„๋ง

* thymeleaf : html ํƒœ๊ทธ์— ์†์„ฑ์„ ์ถ”๊ฐ€ํ•ด ํŽ˜์ด์ง€์— ๋™์ ์œผ๋กœ ๊ฐ’์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜๋Š” ๊ฒƒ.

* spring boot starter ? : npm์ฒ˜๋Ÿผ ๊ฐ„ํŽธํ•˜๊ฒŒ dependency๋ฅผ ์ œ๊ณตํ•ด์ฃผ๋Š”๋ฐ, JPA๊ฐ€ ํ•„์š”ํ•˜๋‹ค๋ฉด prom.xml(Maven) ์ด๋‚˜ build.gradle(Gradle)์— 'spring-boot-starter-data-jpa'๋งŒ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ์•Œ์•„์„œ spring boot๊ฐ€ ๊ทธ์— ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋ฐ›์•„์˜ด.

   - ์‚ฌ์šฉ๋ฐฉ๋ฒ• : spring-boot-starter-*

   - * ๋ถ€๋ถ„์— ์›ํ•˜๋Š” ์Šคํƒ€ํ„ฐ๋ช…์„ ๋ช…์‹œํ•˜๋ฉด ๋จ.

728x90
๋”๋ณด๊ธฐ
BACKEND/SpringBoot