Foundations for Spring Boots
Spring Boot foundations are the core ideas behind every application: the Spring IoC container, beans and dependency injection, plus how Boot adds auto-configuration and starters on top. Configuration through application.properties or application.yml and profiles lets the same code run in different environments. Everything else in the framework builds on this layer.
Stage: Spring Core · Part of the Spring Boot roadmap · Last reviewed 19 November 2026
What to learn in Foundations
- Explain how the container creates beans and injects dependencies through constructors
- Generate a project with Spring Initializr and read the starter dependencies it adds
- Bind configuration values to a typed class using @ConfigurationProperties
- Switch settings per environment with Spring profiles
- Use the --debug flag to see which auto-configurations were applied
Foundations interview questions
What does @SpringBootApplication do?
It combines three annotations: @Configuration to mark a class as a source of beans, @EnableAutoConfiguration to let Boot configure beans based on the classpath, and @ComponentScan to find components in the package and its sub-packages. It is the entry point that bootstraps the app.
Why is constructor injection preferred over field injection?
Constructor injection makes dependencies explicit and lets fields be final, so objects are never half-built. It also allows plain unit tests that pass mocks without starting Spring. Field injection hides dependencies and needs reflection, which makes testing and spotting circular dependencies harder.
Where Foundations fits in the Spring Boot roadmap
Foundations belongs to the Spring Core stage (beginner level), which takes about 28 hours. The container.
Other units in this stage
Back to the full Spring Boot roadmap