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 (154)
  • 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)
  • spring-boot (36)
  • Systems Thinking (3)
  • GitHub Weekly: MCP Tools Trending Right Now (September 28 – October 4, 2026)
  • The Bulkhead Pattern: Why One Slow Dependency Shouldn’t Sink the Whole Ship
  • Essential Reading: A Philosophy of Software Design — Fighting Complexity One Module at a Time
  • GitHub Weekly: Top 10 Trending Repos (September 21 – September 27, 2026)
  • The Volunteer Tax: Why Raising Your Hand in a Meeting Makes You the Permanent Owner
©2026 José da Cruz | WordPress Theme by SuperbThemes