Why Spring & Spring Boot
Before any annotation makes sense, you need to know what problem it's solving. Spring wasn't the first way to write Java backends — it was a reaction to how painful the alternatives were.
Learning objectives
- Beginner: Explain in your own words why Spring exists — what manual plumbing it removes that plain Java would otherwise force you to hand-build.
- Intermediate: Correctly distinguish what Spring Framework solves versus what Spring Boot adds on top of it, without conflating the two.
- Advanced: Read a Spring Boot version's minimum JDK requirement before starting a project, and explain why mismatching it causes confusing build failures rather than a clear error.
◆ The problem
A real backend needs to handle HTTP requests, talk to a database, manage transactions, validate input, secure endpoints, and wire dozens of collaborating objects together correctly. None of that is provided by the Java language itself — you'd have to hand-build an HTTP server, a connection pool, a routing layer, and object wiring from scratch for every single project.
Spring exists to provide all of that as a coherent, reusable platform: a container that creates and wires your objects (Module 02), a web layer that turns HTTP requests into method calls (Module 06), and consistent abstractions over databases, security, and messaging so you write business logic instead of plumbing.
| Piece | What it is |
|---|---|
| JVM (Java Virtual Machine) | Executes compiled Java bytecode — the reason Java code runs identically across operating systems. |
| JDK (Java Development Kit) | The full toolkit for developing Java software: compiler, JVM, standard libraries. You install a JDK version (e.g. 17 or 21) to build a Spring Boot project. |
| IDE (IntelliJ IDEA, VS Code, Eclipse) | Where you actually write code — IntelliJ IDEA is the most common choice for Spring Boot development, with strong built-in Spring support. |
▲ Pitfall
Spring Boot 3.x requires Java 17 as a minimum (Spring Boot 4.x moves to Java 21+). Installing an older JDK and then fighting confusing build errors is one of the most common early stumbling blocks — check your Spring Boot version's minimum Java requirement before anything else.
◆ The problem
The original Spring Framework solved the object-wiring problem (Module 02) but still required substantial manual XML or Java configuration to set up a working web application — configuring a DispatcherServlet, a database connection pool, and dozens of beans by hand before writing a single line of business logic.
Spring Boot is not a replacement for Spring — it's Spring plus opinionated auto-configuration (Module 04) and starter dependencies (Module 05) that eliminate almost all of that manual setup. Spring Boot's core promise is "convention over configuration": sensible defaults that work out of the box, with the ability to override any of them explicitly when you need to.
| Plain Spring | Spring Boot | |
|---|---|---|
| Web server setup | Manually configure and deploy to an external servlet container | Embedded Tomcat included — run as a plain executable JAR |
| Bean configuration | Explicit XML or @Configuration classes for nearly everything | Auto-configuration wires sensible defaults from what's on the classpath |
| Dependency management | Manually track compatible versions of each library | Starter dependencies bundle compatible, tested versions together |
Spring Boot projects are almost always bootstrapped via Spring Initializr (either the web UI at start.spring.io, or built directly into IntelliJ IDEA's "New Project" wizard) rather than assembled by hand — you pick your build tool, Java version, and starter dependencies, and it generates a ready-to-run project skeleton.
@SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
◆ Under the hood
@SpringBootApplication is itself a composite of three annotations you'll meet properly in Module 04 — @Configuration, @EnableAutoConfiguration, and @ComponentScan. A single annotation on your main class is what kicks off the entire container bootstrap process covered in Module 02.
✓ Quick recap
Is Spring Boot a different framework from Spring, or built on top of it? Built on top of it — Spring Boot adds auto-configuration and starters on top of the same underlying Spring Framework. What does "convention over configuration" mean in Spring Boot's context? Sensible defaults work automatically, but every default can still be explicitly overridden when needed.
💻 Code example
@SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
Want a visual for this concept?
Generate a diagram tailored to “Why Spring & Spring Boot” — the AI picks whichever visual (flowchart, comparison, sequence, etc.) best fits.
Sign in to generate a visual →