Spring Core Concepts
15 lessons in this section of the Spring Boot tutorial. Work through them in order, or jump to the one you need.
- 1.Inversion of Control (IoC)
Inversion of Control is the foundational design principle behind Spring Framework.
- 2.Dependency Injection (DI)
Dependency Injection is the mechanism Spring uses to implement Inversion of Control.
- 3.Bean Lifecycle
Spring bean lifecycle explained step by step: instantiation, injection, @PostConstruct, @PreDestroy, BeanPostProcessor, scopes and lazy init, with Java examples.
- 4.Bean Scopes
Bean scope determines how many instances of a bean Spring creates and how long each instance lives.
- 5.ApplicationContext
ApplicationContext is the central interface of the Spring IoC container.
- 6.BeanFactory
BeanFactory is the root interface of Spring's IoC container — the most basic form of the container that provides dependency injection and bean management.
- 7.Component Scanning
Component scanning is the mechanism Spring uses to automatically discover and register beans.
- 8.Java-based Configuration
Java-based configuration uses @Configuration classes and @Bean methods to define Spring beans programmatically — replacing XML configuration with type-safe, IDE-friendly…
- 9.XML-based Configuration
Learn Spring XML-based configuration: bean declaration, constructor and setter injection, namespaces, importing files, @ImportResource in Spring Boot, and a step-by-step…
- 10.Constructor Injection
Constructor injection is the recommended dependency injection style in Spring.
- 11.Setter Injection
Learn Spring setter injection: how it works, when it beats constructor injection (optional dependencies), alternatives such as Optional and ObjectProvider, circular…
- 12.Qualifier Annotation
The @Qualifier annotation resolves ambiguity when Spring finds multiple beans of the same type.
- 13.Primary Annotation
The @Primary annotation marks one bean as the default candidate when multiple beans of the same type exist in the Spring container.
- 14.Lazy Initialization
By default, Spring creates all singleton beans at application startup — eager initialization.
- 15.Environment & Profiles
How Spring Boot 3 configuration works: the Environment abstraction, the exact order in which property sources override each other, relaxed binding for environment…