Spring 구성은 Spring에게 맡기고 비즈니스 로직에만 집중하자
- Spring Boot의 핵심 컨셉 -
Spring Boot란?
: Spring Framework의 편리함에도 불구하고 Spring 설정의 복잡함으로 인해 Spring 기반 애플리케이션 개발을 시작하기도 전에 어려움을 겪는 문제점을 해결하기 위해 생겨난 Spring Project 중 하나
[Spring Boot 사용 이유]
1. XML 기반의 복잡한 설계 방식 지양
2. 의존 라이브러리의 자동 관리
: starter 모듈 구성 기능을 통해 의존 라이브러리를 수동으로 설정할 필요가 없음
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'com.h2database:h2'
}
* 웹 애플리케이션 개발을 위한 기본적인 의존 라이브러리 설정 예시
3. 애플리케이션 설정의 자동 구성
: Starter 모듈을 통해 설치되는 의존 라이브러리를 기반으로 애플리케이션 설정을 자동으로 구성함
Ex) “implementation 'org.springframework.boot:spring-boot-starter-web’” 와 같은 starter가 존재한다면 애플리케이션이 웹 애플리케이션이라고 추측한 뒤, 웹 애플리케이션을 띄울 서블릿 컨테이너(디폴트: Tomcat) 설정을 자동으로 구성
@SpringBootApplication // (1) 자동 구성 설정을 활성화
public class SampleApplication {
public static void main(String[] args) {
SpringApplication.run(SampleApplication.class, args);
}
}
>> 자동 구성 설정을 위해 애너테이션 코드 추가가 필요함
4. 프로덕션급 애플리케이션의 손쉬운 빌드
: 결과물을 직접 War 파일 형태로 WAS(Web Application Server)에 올릴 필요가 없음
* WAS : 구현된 코드를 빌드해서 나온 결과물을 실제 웹 애플리케이션으로 실행되게 해주는 서버
5. 내장된 WAS를 통한 손쉬운 배포
'공부 자료 > Spring' 카테고리의 다른 글
[Spring Core] 빈(Bean) (1) | 2022.10.13 |
---|---|
[Spring Core] 스프링 컨테이너(Spring Container), 스프링 컨텍스트(Spring Context) (0) | 2022.10.13 |
[Spring Core] 아키텍처로 보는 Spring Framework Module 구성 (0) | 2022.10.12 |
[Spring Core] AOP (Aspect Oriented Programming) (0) | 2022.10.11 |
[Spring Core] DI (Dependency Injection) (0) | 2022.10.11 |