Spring Boot Fundamentals — *Why Spring Boot?*
Spring Boot Fundamentals — *Why Spring Boot?*
🎯 After reading this lesson
After completing this lesson, you will be able to confidently do the following three things:
- ▸✅ Define Spring's three core principles (IoC · AOP · POJO) in one sentence
- ▸✅ Distinguish the roles of @Component / @Service / @Repository / @Controller
- ▸✅ Explain why Spring Boot put an end to the XML configuration hell of classic Spring
Keep these learning objectives as a checklist — close the lesson only once you can answer all of them.
What Is Spring — *Simplifying Complex Java Backends*
One-Line Summary
Spring = A framework that automatically handles repetitive, complex tasks when building servers in Java. Created in 2003 by Rod Johnson.
Why Spring Was Born
In the early 2000s, Java backends were built using a standard called EJB (Enterprise JavaBeans), which was notoriously complex. Even a simple feature required numerous configuration files, interfaces, and implementation classes. Developers complained that 'there is more configuration code than business logic.'
Spring stripped away that complexity, making it possible to build servers with plain Java objects (POJO). The paradigm in which the framework handles cross-cutting concerns like DI, AOP, and transactions spread explosively.
Spring vs Spring Boot — What Is the Difference?
Spring alone was far simpler than cumbersome EJB, but it still required a lot of configuration: dozens of XML configuration lines, installing an external Tomcat server, building and deploying WAR files...
Spring Boot (2014~) is an evolution that goes one step further with the philosophy of 'we handle configuration too.'
Most developers use Spring Boot. When people say "Spring," they usually mean Spring Boot.
Why Spring Dominates in Korea
Over 80% of backend job listings in Korea require Spring. Kakao, Naver, Coupang, Toss, Daangn — all Spring-based. The reasons:
- ▸In the early 2010s, the e-Government Framework was standardized on Spring
- ▸Large enterprise SI companies built their systems with Spring
- ▸As a result, developers, resources, and education all became Spring-centric
For anyone aiming to become a backend developer in Korea, Spring is practically a requirement.
Auto-configuration — The Magic of Spring Boot
Add just the spring-boot-starter-web dependency and you get:
- ▸Embedded Tomcat started
- ▸DispatcherServlet registered
- ▸Jackson JSON serialization enabled
- ▸Static file serving (
/static/·/public/) - ▸Default error page
All of this works with zero lines of code. Spring Boot looks at what is on the classpath and applies sensible defaults.
To change a setting, one line in application.properties or application.yml is enough:
Summary
- ▸Spring = Java backend framework (2003~)
- ▸Spring Boot = Spring + auto-configuration and embedded server (2014~)
- ▸80%+ of Korean backend job listings are Spring-based
- ▸A production-ready server can be started in under 5 minutes
How to *Start* a Spring Boot Project
The Fastest Start — start.spring.io
https://start.spring.io — A project generator built by the Spring team. A working server in 5 minutes.
Options to choose:
- ▸Project: Gradle recommended (Maven is also OK)
- ▸Language: Java
- ▸Spring Boot Version: Latest stable release (3.x)
- ▸Dependencies: At minimum
Spring Web(REST API). Common additions:Spring Data JPA,H2 Database,Lombok
Click GENERATE to download a zip file. Unzip it, open it in your IDE, and you are done.
Three Key Files
1. Main class — server entry point:
The single @SpringBootApplication annotation does three things at once:
- ▸
@Configuration— declares this class as a configuration class - ▸
@EnableAutoConfiguration— enables auto-configuration - ▸
@ComponentScan— automatically registers@Component,@Service, etc. in sub-packages
2. application.yml — configuration:
3. First controller:
Run ./gradlew bootRun → visit http://localhost:8080/hello → get the response 'Hello, Spring Boot!'
Directory Structure
This is the standard Spring project structure — the first thing you will encounter at a company.
Common First-Time Mistakes
1. @SpringBootApplication placement: The main class must be in the top-level package. This is because it automatically scans @Components in sub-packages. If placed incorrectly, beans will not be registered.
2. Port conflict: If another process is already using port 8080, startup will fail. Change to server.port: 8081 or kill the existing process.
3. application.yml indentation: YAML is sensitive to 2-space indentation. Using tabs will cause errors. Stick to 2 spaces.
Summary
Download a zip from start.spring.io → open in IDE → add @RestController + @GetMapping → run bootRun → done. This is a flow achievable in under 5 minutes. Try it once and you will immediately feel the appeal of Spring Boot.
🤖 Try Asking an AI Like This
Once you understand the concepts in this lesson, you can give specific instructions to AI. Instead of a vague 'please fix this,' you make requests with vocabulary — that is the starting point for saving tokens.
- ▸'Apply the Spring Boot Fundamentals — Why Spring Boot? pattern to this Spring Boot code'
- ▸'Write a @SpringBootTest integration test related to Spring Boot Fundamentals — Why Spring Boot?'
- ▸'Tell me 3 pitfalls to watch out for when using Spring Boot Fundamentals — Why Spring Boot? in real projects'
Why This Saves Tokens
When you do not know the concepts, you have to ask 'what is that?' after receiving an AI response. That follow-up question is what eats your tokens. Learn a concept once and the conversation ends in one go.