Skip to main content

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

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.

Back to the full Spring Boot roadmap