Spring Boot Dependency Injection Explained: Types, Issues, and Solutions

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 มิ.ย. 2024
  • "Welcome to our Spring Boot series! In this video, we dive into the concept of Dependency Injection in Spring. You'll learn what Dependency Injection is, the different types of Dependency Injection, and common issues like cyclic dependencies and unsatisfied dependencies. We'll also provide solutions to these problems to help you write cleaner, more maintainable code.
    Related Video Links :
    1. Bean Lifecycle - • Understanding Spring B...
    2. Spring Annotations Explained:
    • Spring Annotations Exp...
    Follow on Instagram : / codesnippet.java
    🔔 Don't forget to like, share, and subscribe for more Spring Boot tutorials! If you have any questions or topics you'd like us to cover, leave a comment below.
    Topics Covered:
    What is Dependency Injection?
    Types of Dependency Injection (Constructor, Setter, Field)
    Common Issues: Cyclic Dependency & Unsatisfied Dependency
    Solutions to Dependency Injection Problems
    #SpringBoot #DependencyInjection #Java #SpringFramework #CodingTutorial #Programming #SoftwareDevelopment #TechTips #LearnJava"
    Tags:
    Spring Boot
    Dependency Injection
    Java
    Spring Framework
    Coding Tutorial
    Programming
    Software Development
    Cyclic Dependency
    Unsatisfied Dependency
    Tech Tips
    Learn Java
    Java Tutorial
    Spring Boot Tutorial
    Developer Tips
    Hashtags:
    #SpringBoot #DependencyInjection #Java #SpringFramework #CodingTutorial #Programming #SoftwareDevelopment #TechTips #LearnJava #JavaProgramming #CodeBetter #CleanCode

ความคิดเห็น • 14

  • @dhananjaygavnang6403
    @dhananjaygavnang6403 26 วันที่ผ่านมา +2

    Since last 10 days I was looking for dependency injection concept but couldn’t understood that clearly. But your explanation with simple example is just 🤩, Thanks for such contents

  • @rajumanchikatla1285
    @rajumanchikatla1285 21 วันที่ผ่านมา +1

    Thanks to CodeSnippet, I finally understood dependency injection. I’ve been trying to grasp it for the past ten days, but no luck. Then I saw your video and everything just clicked. I especially liked the simple example. The only thing that would make this video better is adding a definition to the concept. Thank you for this content!

    • @CodeSnippet.java.
      @CodeSnippet.java.  20 วันที่ผ่านมา

      Thanks brother. Happy to help 👍🏻. I will definitely work on feedback. Thanks for highlighting ❤️

  • @karunsaipavuluri990
    @karunsaipavuluri990 21 วันที่ผ่านมา +1

    Good Work Bro 👌👌

  • @universal4334
    @universal4334 21 วันที่ผ่านมา +1

    Though you change order class to interface, that interface might have multiple implementations, and that creates confusion on which object should be injected. You say you've @primary or @qualifier, if you do that, then again, it is tight coupling, right ?

    • @CodeSnippet.java.
      @CodeSnippet.java.  21 วันที่ผ่านมา

      In that case you are using abstraction and adhering to solid principles. That is not tight coupling

  • @prathameshchaudhari1337
    @prathameshchaudhari1337 26 วันที่ผ่านมา +1

    Another one much needed 🎉❤

  • @18BD204BalaRaju
    @18BD204BalaRaju 12 วันที่ผ่านมา +1

    Even though you have added the parameterized constructor for User(while explaining Constructor injection) how the bean is created?because Spring should be looking for only default constructor for creating bean

    • @CodeSnippet.java.
      @CodeSnippet.java.  6 วันที่ผ่านมา

      Apologies for delay in reply brother.
      In this case, spring is aware about all the parameters of user constructor , for eg. order bean which is again a spring bean. So while creating object of user. It will use same bean and inject it inside your user class. And create bean of user.

    • @balubachu2511
      @balubachu2511 5 วันที่ผ่านมา

      @@CodeSnippet.java. 18:43 so,you mean to say that ‘ as long as the parameters are known to spring then there is no problem in creating the bean’?

  • @sumithhh9379
    @sumithhh9379 16 วันที่ผ่านมา +1

    Can you share the github link?