Spring Boot: conditional assembly, not sorcery
Prerequisites: 01-ecosystem
Why was an infrastructure bean created?
Goal & mental model verified
Boot auto-configuration uses available classes, properties and existing beans to configure infrastructure. User definitions can cause defaults to back off. Starters assemble related dependencies; dependency management aligns versions.
[S21] [S02]Worked example · design exercise synthesis
Add a database driver and the relevant starter, supply connection properties, and Boot can create infrastructure beans. Define your own DataSource and the matching default may no longer apply.
[S21] [S02] [S20]Engineering decision synthesis
Keep Boot-managed versions aligned unless an override has a documented reason. Select a supported runtime and build tool for your chosen generation.
[S21] [S02] [S20]Pitfall & diagnosis synthesis
A starter can activate unexpected configuration. Mixing individual Spring versions may produce linkage errors. A bean declared too broadly can accidentally replace a useful default.
[S21] [S02] [S20]Improve & validate synthesis
Use the condition evaluation report to understand why configuration matched or failed. Record custom overrides and test upgrades against startup and representative paths.
[S21] [S02] [S20]Check yourself: Does adding a starter guarantee a working database?
No. Driver, credentials, reachable infrastructure and matching configuration still matter.