
어떤 유튜브를 보다가 거기에서 이런 질문이 나왔다. 그래서 "spring framework와 spring boot의 차이는 뭘까요?" 나는 이 대답에 대해 spring boot가 더 편하게 쓸 수 있는거라는 대답만 떠올랐다. 그래서 차이점에 관해 공부해야겠다고 생각했다. 이번 포스팅에서는 두개의 차이에 관해 알아보고자 한다.
Spring FrameWork란 자바 플랫폼을 위한 오픈 소스 애플리케이션 프레임워크이다. 간단하게 spring이라고 부른다.
Spring 이전에는 EJB라는 기술이 자바 표줄 기술이었다. EJB는 개발자들이 비즈니스 로직에 집중할 수 있게 만들어진 기술이었다. 그러나 몇몇 문제점이 있었다.
스프링 프레임워크의 기능이 점점 커져가고, 다양한 오픈소스의 등장으로 외부 라이브러리를 함게 사용할 일이 많아졌다. 결과적으로 스프링을 이용해 개발을 시작할 때, 해야하는 설정이 너무 많아지고 복잡해졌다.
✅ 이에 따라 개발자들은 좀 더 설정을 편리하게 해줄 수 있는 것이 필요했고, 그렇게 Spring Boot가 탄생하게 됐다.
‼️Spring Boot의 공식 문서에서는 이렇게 소개하고 있다.
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run"
✅ 즉, Spring 기반 애플리케이션을 쉽게 만들 수 있게 해주며, 별다른 설정 없이 바로 실행할 수 있게 해주는 것이다.
이제 Spring Boot의 장점을 한 번 살펴보자.
@SpringBootApplication 어노테이션 하나로 자동 설정
application.yml 또는 application.properties 파일을 통해 손쉽게 설정 변경AutoConfiguration이 미리 등록되어 있어 빠른 개발 가능dependencies {
implementation 'org.springframework:spring-context:6.2.4'
implementation 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
spring-boot-starter-*를 통해 관련 의존성을 한 번에 묶어서 제공BOM(spring-boot-dependencies)이 라이브러리 버전들을 전부 맞춰서 관리dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}