Skip to content
José da Cruz

Enterprise Architect, and Life Thinker

José da Cruz

Enterprise Architect, and Life Thinker

Learning Spring Boot from Zero to Cloud: Part 29 – @Configuration @Beans and RowMappers?

josedacruz, May 13, 2025May 13, 2025

Welcome to another video in our Spring Boot Deep Dive series!
In this episode, we explore a powerful but often misunderstood part of the framework: @Bean methods inside @Configuration classes.

If you’ve ever wondered when to use @Bean instead of @Component, how Spring wires your dependencies behind the scenes, or how to avoid common pitfalls — this video is for you.

We’ll break down how Spring treats method calls inside @Configuration classes, and you’ll learn to use that behavior to wire beans like JdbcTemplate with custom RowMapper implementations.


✅ What You’ll Learn

🎯 What’s really happening behind the scenes with @Bean
🔄 When to use @Bean instead of @Component
🧩 How Spring resolves dependencies between @Bean methods
🧠 The proxy magic and caching behavior inside @Configuration
🔧 Cleanly wiring beans together — like JdbcTemplate with a custom RowMapper
🚫 Common anti-patterns to avoid (yes, stop using new manually!)
🧪 How to override beans in your tests using @TestConfiguration


⏱️ Timestamps

00:00 – Introduction
00:33 – What Is a @Bean and How Does It Work?
02:23 – @Bean vs @Component: Which One Should You Use?
05:25 – Manual Bean Wiring
08:48 – Inter-bean Method Calls and Caching
11:58 – Internals: How Spring Intercepts @Bean Method Calls
13:27 – When Should You Use @Bean?
14:44 – 3 Anti-Patterns: Using new , Logic-Heavy Config Classes, Mutable Singleton Beans
18:15 – Testing: Using @TestConfiguration to Override Beans
18:40 – Summary & Final Tips
21:13 – Code Session


📌 Don’t forget to:

✔️ Like
✔️ Subscribe
✔️ Share with your Spring Boot friends

Related

spring-boot

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • architecture (167)
  • artificial-intelligence (6)
  • books (2)
  • courses (4)
  • decision-frameworks (4)
  • finances (1)
  • java (8)
  • life-improvement (20)
  • metrics (3)
  • observability (2)
  • puzzles and challenges (3)
  • reviews (1)
  • security (8)
  • Soft Skills (1)
  • spring-boot (36)
  • Systems Thinking (3)
  • GitHub Weekly: AI Agent Tools Trending Right Now (November 2 – November 8, 2026)
  • Designing a Distributed Session Store: Why Sticky Sessions Break Under Load
  • Essential Reading: Release It! — Why Production Is a Different Game Than Development
  • GitHub Weekly: Top 10 Trending Repos (October 26 – November 1, 2026)
  • GitHub Weekly: Architecture & Infra Tools Worth a Look (October 19 – October 25, 2026)
©2026 José da Cruz | WordPress Theme by SuperbThemes