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 – Introduction00:33 – What Is a @Bean and How Does It Work?02:23 – @Bean vs @Component: Which One Should You Use?05:25 – Manual Bean Wiring08:48 – Inter-bean Method Calls and Caching11:58 – Internals: How Spring Intercepts @Bean Method Calls13:27 – When Should You Use @Bean?14:44 – 3 Anti-Patterns: Using new , Logic-Heavy Config Classes, Mutable Singleton Beans18:15 – Testing: Using @TestConfiguration to Override Beans18:40 – Summary & Final Tips21:13 – Code Session 📌 Don’t forget to: ✔️ Like✔️ Subscribe✔️ Share with your Spring Boot friends Related spring-boot