The Spring container assembles typed dependencies and controls managed object lifetimes.
Learning roadmap
Read the contract, run the source-kit checks, and inspect a rejected input before extending the application. This subject covers Spring and Spring Boot together; Java language lessons remain in their own subject.
Prerequisites
Use Java object ownership, interfaces, exceptions and Maven builds before the framework-specific lessons.
Section lessons
- Spring ApplicationContext: construct and close an object graph
- Spring constructor injection: required dependencies stay visible
- Spring qualifiers: select a collaborator when types are ambiguous
- Spring bean scopes: singleton identity is not thread safety
- Spring ObjectProvider: deferred resolution without hiding ownership
- Spring lifecycle cleanup: close container-owned resources
- Spring application events: local delivery is not a durable queue
- Spring AOP proxies: self-invocation bypasses proxy advice
- Spring transaction events: run a listener after commit without claiming durability
- Spring request scope proxy: resolve state for the current HTTP request
- Spring session scope: one target across requests, separate targets across sessions
- Spring @Async futures: make worker failure observable to the caller
- Spring async work versus durable delivery: separate latency from recovery
- Spring task executors: reject work when every slot is occupied
- Spring async work has two failure points: submission and completion
- Spring TaskScheduler: poll committed outbox rows in the background
- Spring TaskScheduler shutdown: stop new polls and account for in-flight work
Continue learning
Boot Foundations, Web APIs, Data & Transactions, Security, Testing, Production, Exercises, Quizzes, Projects.
Register the object graph
- Spring @Component versus @Bean: choose who constructs the dependency
- Spring circular dependencies: break the constructor graph
New checked lessons
- Spring @Primary and @Qualifier: default selection versus an explicit bean
- Spring @Configuration proxyBeanMethods: direct calls can create a second object
- Spring @Order on injected lists: execution order is not startup order
New checked lessons
- Spring @Lazy singleton: failure moves from context refresh to first use
- Spring @Lazy injection point: defer a dependency behind a proxy
- Spring @DependsOn: force initialization and reverse destruction order
Modulith module and event boundaries
- Spring Modulith module APIs: call the inventory root package, not its internals
- Spring Modulith events: publish a domain fact after a valid state change
Modulith event and module tests
Container extension and shutdown contracts
- Spring BeanFactoryPostProcessor: inspect definitions before instances exist
- Spring BeanPostProcessor: instance callbacks and the early-bean trap
- Spring FactoryBean: expose the product type without constructing it
- Spring SmartLifecycle phases: drain work before destroying dependencies
Container identity, events and proxy boundaries
- Spring singleton state: one bean does not mean one request at a time
- Spring generic autowiring: preserve type arguments at the injection point
- Spring @Lookup: obtain a fresh prototype from a singleton method
- Spring synchronous event listener failure: publication can fail the caller
- Spring async event listener: handle detached failures and queue pressure
- Spring AOP final methods: advice requires an interceptable call
