What is Dependency Injection? | Why | Spring

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2018
  • Check out our courses:
    Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : bit.ly/java-spring-cloud
    For More Queries WhatsApp or Call on : +919008963671
    website : courses.telusko.com/
    Instagram : / navinreddyofficial
    Linkedin : / navinreddy20
    TELUSKO Android App : bit.ly/TeluskoApp
    Discord : / discord
    Spring Dependency Injection.
    Practical : goo.gl/VZZnDT
    In software engineering, dependency injection is a technique whereby one object (or static method) supplies the dependencies of another object. A dependency is an object that can be used (a service). An injection is the passing of a dependency to a dependent object (a client) that would use it. The service is made part of the client's state.[1] Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.
    -wikipedia
    Dependency Injection is a design pattern.
    In this video we will see :
    - What is Dependency Injection
    - Why it is so famous
    - An example of Dependency Injection explaining the process.
    - Object dependency
    - Loose Coupling
    - Tight Coupling
    - Dpendency injectction container
    - Spring container
    - Spring Boot
    - @Component
    - @Autowired
    - Testing
    - Mock Object
    - Maintenance
    Java and Spring Framework For beginners with Spring Boot : - bit.ly/3LDMj8D
    Java Tutorial for Beginners (2023) :- bit.ly/3yARVbN
    Editing Monitors :
    amzn.to/2RfKWgL
    amzn.to/2Q665JW
    amzn.to/2OUP21a.
    Subscribe to our other channel:
    Navin Reddy : th-cam.com/channels/xmk.html...
    Telusko Hindi :
    th-cam.com/channels/itz.html...
    #spring #Dependencies
    Donation:
    PayPal Id : navinreddy20
    Patreon : navinreddy20
    www.telusko.com/contactus
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @dhananajaykrishna8259
    @dhananajaykrishna8259 3 ปีที่แล้ว +62

    You're not just a programmer but also an awesome story teller. When asked about dependency injection people make it so complex that you start scratching your head.... But you explained like it was a piece of cake. 🙏

  • @deleater
    @deleater 5 ปีที่แล้ว +43

    Big brother, you speak so beautifully your words directly injects into my brain without an error at all. Everything becomes so comprehensible when you explain it.

  • @mahmudhr2760
    @mahmudhr2760 5 ปีที่แล้ว +12

    Sir, from the beginning of my programming you have been with me. Thank you so much for your instructions !

  • @AnthonyHernandez-tb4cu
    @AnthonyHernandez-tb4cu 2 ปีที่แล้ว +3

    I have watched more of your videos to learn SWE topics than I can count. You have been instrumental in allowing me to understand these concepts intuitively. Big thanks!

  • @doglover4621
    @doglover4621 5 ปีที่แล้ว +18

    One of the best TH-camr in teaching. Seriously I learned a lot from this channel

  • @krishnabangari9287
    @krishnabangari9287 8 หลายเดือนก่อน +1

    Man, 5 years old video and still the best explanation about dependency explanation. This guy truly knows the subject, and he knows which example to pick to explain what topic. He has the teaching spirit in him. Hands down the best youtube channel. whenever, i have a doubt i come here, dang the concepts are much clear. Kudos to you brother.

  • @RAJATTHEPAGAL
    @RAJATTHEPAGAL 6 ปีที่แล้ว +26

    Really good explanation I covered Software Engineering recently + have been using Spring and Angular and never actually realised about this loosely coupled idea. Nice philosophy behind how project should be managed. Also the part of testing that loose coupling makes it easier to test, never realised that :-D ...... Great explanation a bit of practical would be plus ...

  • @yosukeyoh
    @yosukeyoh 3 ปีที่แล้ว

    this is the best explanation about dependency injection in Spring ive heard so far. Simple but I can understand it so well! Thank you!

  • @ShivamSingh-yl7jo
    @ShivamSingh-yl7jo 3 ปีที่แล้ว +16

    Best tutorial on dependency injection. Finally, I got what it really is.

  • @karthickd8251
    @karthickd8251 5 ปีที่แล้ว +10

    My day starts with Telusko

  • @stevensmith5626
    @stevensmith5626 2 ปีที่แล้ว +5

    Fantastic explanation that takes away the confusion. We tend to use such big words when a simple explanation is the best way. I have been doing this concept since 1975 and it always amuses me when the industry comes up with a new concept that really is just doing good programming with a different word. Great job!

  • @piyushbhuva9975
    @piyushbhuva9975 2 ปีที่แล้ว +2

    man, the passion and joy of teaching in this guy's eyes is sight to behold...

  • @dpatel4362
    @dpatel4362 5 ปีที่แล้ว +2

    Thanks for a very thorough and simple explanation. Your tutorials are addictive. God bless you.

  • @neerarjayan5957
    @neerarjayan5957 5 ปีที่แล้ว

    You are the God of Java dude.. I was searching this explanation for a whole week and i got that within 8 mins from your video. Thanks a lot.

  • @AdamVigas
    @AdamVigas 2 ปีที่แล้ว

    This guy is teaching me everything...i am not even browsing youtube. Once i find this guy i go ahead...and it always work. Best teacher

  • @gregc6107
    @gregc6107 4 ปีที่แล้ว +6

    At it's core, dependency injection centralizes the creation of concrete objects that your client (meaning your code) uses and can use in many places. This provides many benefits, first you are able to easily switch out the implementation, you are able to easily test the implementation, and you are able to wrap or manipulate how you want it to instantiate. Whether it be wrapping authentication around it or adding pre and post processing, or auditing/logging to it and you can do this retroactively in the entire system in a very easy manner.

  • @hinafraz528
    @hinafraz528 4 ปีที่แล้ว +18

    thanks for using classes on screen. got some idea of the concept.

  • @urvashisharma7415
    @urvashisharma7415 3 ปีที่แล้ว

    ive been wandering around for days trying to find a proper explanation for DI...and although im focussed on DI in Dart this video was the BEST to understand what it means...thank you very much sir

  • @awaisjamil5713
    @awaisjamil5713 9 หลายเดือนก่อน

    I am thankful to you, I remember after graduation your videos were the source of preparation material for me for interviews and I landed a job. Respect from Pakistan.

  • @vladanulardzic5859
    @vladanulardzic5859 6 ปีที่แล้ว +5

    Excellent explanation based on real practical example ! Thank you for sharing this valuable knowledge. Vladan Ulardzic

  • @iarpanbose
    @iarpanbose 2 ปีที่แล้ว +20

    Im 7+ yr experience in java and spring and i always screwed up the defination of dependency injection in the interviews 🤣

  • @sagarkapasi099
    @sagarkapasi099 6 ปีที่แล้ว

    This is the first time i understood dependency injection and the jargons related to it! Thanks.

  • @srijan5298
    @srijan5298 5 ปีที่แล้ว +25

    Sir i'm a student of Cdac and even teachers here, also dont explain concepts like this. Thankyou sir❤

  • @dhanush4422
    @dhanush4422 ปีที่แล้ว +1

    now i understand dependecy injection. what a great examples you use sir. easily understandable even for layman

  • @specialk2720
    @specialk2720 6 ปีที่แล้ว +18

    This guy, men you are a good teacher. I don't know if you know David J. Malan from Havard?
    You and that guy are my best teachers of all time. Good job!

  • @sidique5269
    @sidique5269 4 ปีที่แล้ว +1

    Great Navin Sir you are always there to help me ...no words for this kind of explanation

  • @ramsciutube
    @ramsciutube 6 ปีที่แล้ว +1

    Marvelous teaching style. Superb, Marvelous, Mind blowing.

  • @arindamroy7671
    @arindamroy7671 3 ปีที่แล้ว +1

    Comprehensive and relatable. Nice analogies to explain the concept. Thanks Navin !

  • @ravimule1924
    @ravimule1924 6 ปีที่แล้ว

    I saw so many video's and article about DI but still somewhere i'm confused but you solve it using very simple way...Thanks

  • @Anju02
    @Anju02 3 ปีที่แล้ว

    You just explained the concept nicely manner. Thanks for explaining! finally got it.

  • @felipevillarroel6259
    @felipevillarroel6259 4 ปีที่แล้ว +2

    Thank you for this clarification, I understood it completely!

  • @lifeind4293
    @lifeind4293 3 ปีที่แล้ว

    Simplest and best explanation of DI. Thank you!!

  • @Akki31
    @Akki31 6 ปีที่แล้ว +1

    Very good examplaination sir about dependency injection...
    thanks for explaining in such easy way and you have given a very good example which make us to understand easily amd better way.

  • @RameshJothimani
    @RameshJothimani 4 ปีที่แล้ว +1

    A simple and an excellent explanation. Thank you very much !

  • @SachinSingh-sm7yg
    @SachinSingh-sm7yg 6 ปีที่แล้ว +44

    Sir You're a Greate Teacher.

  • @IreshDissanayakaM
    @IreshDissanayakaM 5 ปีที่แล้ว

    As always, I understood the concept. Thank you!

  • @chinmaydas4053
    @chinmaydas4053 6 ปีที่แล้ว +10

    How great teacher you are.. Lots of love and respect sir.. Great topics.. we need practical implementations of all these concepts in projects..

    • @chinmaydas4053
      @chinmaydas4053 6 ปีที่แล้ว +1

      Thanks for reference.. I have watched the video.. greatly explained sir..

    • @chinmaydas4053
      @chinmaydas4053 6 ปีที่แล้ว +1

      Sir i'm confused wheather i should learn new java10 features like var, garbage collectors etc or it's good or bad and future updates of java bcz oracle now saying many things... Please sir.. make a complete video on all these topics.. would be helpful..

  • @YouradOmrik
    @YouradOmrik 2 ปีที่แล้ว

    Things are easy to understand but difficult to explain, thank you so much
    Sensei.

  • @jagadeeshgurana4490
    @jagadeeshgurana4490 2 หลายเดือนก่อน

    you are the god of simple and elegant explanation of the most complex topics.

  • @nitinjain2490
    @nitinjain2490 3 ปีที่แล้ว

    Clarity of DI is 🔥 by far the best video ❤️

  • @ruvindaranasinghe780
    @ruvindaranasinghe780 6 ปีที่แล้ว

    One of the better Java channels :)

  • @roshanpandey5357
    @roshanpandey5357 3 ปีที่แล้ว

    Yeah, now I understand .. what is dependency injection, why it is required, how it works ... this man is too good #telusko

  • @digitalnomadg
    @digitalnomadg 6 ปีที่แล้ว +2

    Such an enjoyable video. Thank you sir :)

  • @sidharthanayak
    @sidharthanayak 4 ปีที่แล้ว

    Very thorough, simple and informartive explanation!

  • @behzadmokhnefi1636
    @behzadmokhnefi1636 4 ปีที่แล้ว

    The best teacher that i have ever seen , thanks a lot !!!!!!!

  • @88ashwa
    @88ashwa 5 ปีที่แล้ว

    You are a great teacher Naveen garu, than you for the video series..

  • @drinkeatandthink
    @drinkeatandthink 5 ปีที่แล้ว +1

    this is awesome...!♥️God bless you...!🙌🏻

  • @archu0078
    @archu0078 5 ปีที่แล้ว

    You have got very good teacher skill. Awesome 👏 . Very clear and concise

  • @AkashKumar-zo6uf
    @AkashKumar-zo6uf 5 ปีที่แล้ว

    Thank you, Sir. You really made it simple to understand :)

  • @vrchic4411
    @vrchic4411 5 ปีที่แล้ว

    Such a good explanation ! Thanks!

  • @AlayDhagia
    @AlayDhagia 3 ปีที่แล้ว

    Learned a lot. Thank you for putting this up.

  • @KotaSarat52
    @KotaSarat52 6 ปีที่แล้ว

    The knowledge u share to us is priceless

  • @raulguzman8070
    @raulguzman8070 2 ปีที่แล้ว

    Omg man you´re the best. It´s clear your explanation.

  • @MunniDivya
    @MunniDivya 3 ปีที่แล้ว

    hands down! best video with simple explaination

  • @arungore6578
    @arungore6578 5 ปีที่แล้ว +1

    You have improved lot in the area of content delivery.. keep going on

  • @A_A7337
    @A_A7337 ปีที่แล้ว

    Your explonation is amazing. Thank you for the video

  • @cillaqiu7142
    @cillaqiu7142 2 ปีที่แล้ว

    I forgot why I subscribe you, it must because of other video. But I know you save me again, so cleeeeeeeear and understandable. Thank you.

  • @wodiarefaine5076
    @wodiarefaine5076 6 หลายเดือนก่อน

    I thoroughly enjoy the way you explain things; you are undoubtedly talented at it. Personally, I highly value and appreciate the service you provide.

  • @meetalodariya5972
    @meetalodariya5972 4 ปีที่แล้ว +1

    the best explanation I found on the internet................

  • @shanchessmetilda5550
    @shanchessmetilda5550 ปีที่แล้ว

    Hey ! You have it so simple.Thanks for this :)

  • @shuvamsahoo1130
    @shuvamsahoo1130 4 ปีที่แล้ว +2

    Best teacher on TH-cam 😍

  • @ashuzguitar
    @ashuzguitar 4 ปีที่แล้ว +2

    Thank you so much Naveen Reddy !
    I've some experience, and even I found this very useful. So far, I've used @Autowire n number of times to inject @Repositories in my @Services and to inject @Services in my @Controllers.
    But after watching your video, it became crystal clear, why!!
    The example of Hitachi and Samsung Harddrives implementing Harddrive interface and Laptop using loose coupling by means of someone else injecting the dependencies - @Autowire and @Component - is a truly great example, and it has helped me grasp this concept, I'd like to believe, concretely.
    Earlier I knew how to use it, but wouldn't be able to explain so lucidly to some one if they asked WHY. I'd just say do like this, as it is industry standard :D :)
    Similarly, I knew about JUnit testing with Mockito and mocking certain classes, etc. But didn't consciously realize that due to loose coupling only mocking is made possible. I never worried about how mocking is made possible. Now I know. :) \/,
    So, thanks a lot. May god bless you !
    You now have a new subscriber.

  • @praveennarvaneni2970
    @praveennarvaneni2970 ปีที่แล้ว

    The example is awesome. Thank you

  • @jarhrodriguez646
    @jarhrodriguez646 4 ปีที่แล้ว

    Extremely grateful for this explanation sir!

  • @vaibhavbhavsar1
    @vaibhavbhavsar1 5 ปีที่แล้ว

    Quite Impressssive , i understand everything in just 8 min thanks

  • @rissandimo
    @rissandimo 5 ปีที่แล้ว +2

    This is an excellent video, thanks for taking the time to make it! And for the people commenting that he needs to provide some sort of implementation, he posted a link to that in the description: @t

  • @IamShGulati
    @IamShGulati 6 ปีที่แล้ว

    Awesome. So clear and simple.

  • @elizabethakpan979
    @elizabethakpan979 5 ปีที่แล้ว +1

    This is a really great explanation.

  • @jeniljain6928
    @jeniljain6928 4 ปีที่แล้ว +1

    Great explanation!! Really recommended. Thank you :D

  • @zestjaiarun
    @zestjaiarun 5 ปีที่แล้ว

    Awesome! Well done on this tutorial.

  • @softtechbro
    @softtechbro 2 ปีที่แล้ว

    Amazing! I enjoyed this!

  • @BK-nb9or
    @BK-nb9or 3 ปีที่แล้ว

    Very useful and good explanation! Thank you!

  • @wasiqkhan5975
    @wasiqkhan5975 2 ปีที่แล้ว

    I couldn't understand it yet I have to see it once or twice more but it look's like it is the best explaination of dependency injection. thanks

  • @nirajkishore8787
    @nirajkishore8787 5 ปีที่แล้ว

    Very nice videos. The way you have taught spring mvc was awewsome. May I request you please upload the spring boot videos like that ie with creating a basic program.

  • @SA-oh9bk
    @SA-oh9bk 2 ปีที่แล้ว

    Thanks for the real concept of dependency injection.

  • @saikrishnaT
    @saikrishnaT 6 ปีที่แล้ว +5

    Sir, i want to learn Spring, which playlist is suitable for me to learn from scratch? Spring Boot or Spring MVC or any other playlist??

  • @tusharrohilla7862
    @tusharrohilla7862 4 ปีที่แล้ว +1

    Wow, now that's a brilliant explanation 💯💯

  • @berjaoui92
    @berjaoui92 3 ปีที่แล้ว

    Few developpers can explain.
    Telusko can.
    Thanks for sharing.

  • @sachinchinnannavar9514
    @sachinchinnannavar9514 6 ปีที่แล้ว

    Marvelous sir ,I was in need of this concept and you made it very clear thankyou ..please make a video on AOP

  • @shalinidusharla9142
    @shalinidusharla9142 5 ปีที่แล้ว

    Sir, you are a yogi who makes students enlightened.

  • @eliasfonguhnji4898
    @eliasfonguhnji4898 5 หลายเดือนก่อน

    This time I got your explanation for DI very very clear

  • @SyedAli-tc3yu
    @SyedAli-tc3yu 4 ปีที่แล้ว

    I actually enjoyed this.Man O man you are a gem

  • @jameswagstaff1962
    @jameswagstaff1962 5 ปีที่แล้ว +2

    Fantastic explanation! Thanks! Could anybody help with the difference between Dependency Inversion and dependency injection??

  • @sjvait26
    @sjvait26 3 ปีที่แล้ว

    Very good explanation. Thanks.

  • @Yash-xd7ny
    @Yash-xd7ny 3 ปีที่แล้ว

    became fan of your teaching...awesome sir

  • @andreme7326
    @andreme7326 3 ปีที่แล้ว

    You have a talent for teaching.

  • @shraddhabaeet3793
    @shraddhabaeet3793 4 ปีที่แล้ว

    No words.... only will say "CLASSY "!!!!

  • @madanram70
    @madanram70 4 ปีที่แล้ว

    Explained very well.. I like your teaching

  • @ruchikachandra5636
    @ruchikachandra5636 3 ปีที่แล้ว

    Really good explanation. Your example is very understandable.

  • @birdsonwheels4810
    @birdsonwheels4810 5 ปีที่แล้ว

    such a simple explanation..it was awesome Sir

  • @markgoldstein
    @markgoldstein 5 ปีที่แล้ว

    Great explanation, thank you

  • @cm9989
    @cm9989 5 ปีที่แล้ว

    Such an wonderful lecture!!!!!!

  • @ramnivasmurugesan6453
    @ramnivasmurugesan6453 6 ปีที่แล้ว +2

    love you man.. awesome explanation..

  • @KH-hn3nu
    @KH-hn3nu ปีที่แล้ว

    Thank you sir!!! Succinct and engaging explanation.

  • @doomygloomy1
    @doomygloomy1 5 ปีที่แล้ว

    This was a beautiful way to explain it

  • @gyanprakash302
    @gyanprakash302 2 ปีที่แล้ว +1

    This guy is GOLD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @kayeshparvez
    @kayeshparvez 5 ปีที่แล้ว

    Great Tutorial. Very helpful

  • @aditydud
    @aditydud 3 ปีที่แล้ว

    Your videos are always best.

  • @gayathrik8214
    @gayathrik8214 5 ปีที่แล้ว

    Very Very clean explantion.. clean as in understandable tq

  • @7988honey
    @7988honey 2 ปีที่แล้ว

    Great I knew we use this for loosely coupled but the way he told is very good.