Spring Terminology
On your first day on a Spring team, someone says: "The bean isn't in the context because the starter didn't trigger the auto-configuration." Every word in that sentence has a precise meaning, and until you know them, Spring feels like magic. Learn the vocabulary once and the rest of this course reads like plain English.
Throughout the course we build one small service: library-service, a REST API where members borrow and return books. It has a BookController, a LoanService and a BookRepository.
The rule
Spring builds and wires your objects; Boot sets Spring up for you.
The two names are not synonyms.
- Spring Framework is the foundation: a toolkit that creates your objects, connects them to each other, and offers modules for web, data and security.
- Spring Boot sits on top. It picks sensible defaults, bundles a web server, and lets you start an app with one class and a
mainmethod.
Around those two sit the words you will hear every day:
| Word | Plain meaning |
|---|---|
| Bean | An object that Spring creates and manages, such as LoanService |
| Application context | The container that holds all the beans and hands them out |
| Dependency | Another object a bean needs to do its work |
| Starter | One Maven or Gradle dependency that pulls in a whole feature |
| Auto-configuration | Boot creating beans for you because it saw a library on the classpath |
| Properties | Settings in application.properties or application.yml |
@SpringBootApplication
public class LibraryApplication {
public static void main(String[] args) {
SpringApplication.run(LibraryApplication.class, args);
}
}That single run call starts Spring, builds the application context, creates every bean, and, because the web starter is present, starts an embedded Tomcat server on port 8080.