IQ 25: What is Dependency Injection?

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024
  • This video explains the concept of dependency injection

Комментарии • 69

  • @lumenr
    @lumenr 5 лет назад +26

    Service is concrete and should be abstract (Interface) for this example to be 100% loosely coupled. The whole idea DI is to have a loosely coupled design.

  • @davidlavanchy5532
    @davidlavanchy5532 2 года назад +1

    Thanks for the example. Great, comprehensible explanation.

  • @grantmurphy7965
    @grantmurphy7965 5 лет назад +1

    Very well done, not too simple, and not overly complex in the explanation.

  • @ayasalama7533
    @ayasalama7533 6 лет назад

    This was the easiest and clearest video illustrating this concept, thanq

  • @younglife88
    @younglife88 6 лет назад +1

    very good stuff. much more understanding of this concept. Heard it tossed around alot and great :)

  • @rayc3103
    @rayc3103 6 лет назад +1

    Amazing explanation. Very clear and I finally understand it. Your video is better than the other ones I've watched.

  • @lalitchougule7155
    @lalitchougule7155 6 лет назад

    Simple and sweet Explanation
    Thank You !!!

  • @bouhannacheabdallah
    @bouhannacheabdallah 6 лет назад +7

    your sound looks very good ,and so clear, the way you explained/described the idea in developing it was also nice,but you missed the full definition of the term at the first place ,you should be saying ,dependencies are ....,then you go to dig into the subject.thanks anyway.

  • @jkmalify
    @jkmalify 6 лет назад +1

    Very good explanation...clear and understandable

  • @deepakganachari3703
    @deepakganachari3703 6 лет назад

    Clear and simple Explanation..thanks

  • @taureau20
    @taureau20 4 года назад +1

    simple explanation... thank you so much!

  • @arjoojain9809
    @arjoojain9809 6 лет назад

    Simply Awesome!! Thanks! :)

  • @Musa.Almatri
    @Musa.Almatri 6 лет назад +1

    Thanks
    Finally I understood what is dependency injection

  • @edwardcolonhidalgo2465
    @edwardcolonhidalgo2465 6 лет назад

    excellent way to explain dependency injection thank you

  • @yourManLan
    @yourManLan 5 лет назад

    Thank you for this!

  • @apbeers
    @apbeers 3 года назад

    Great video

  • @simc9000
    @simc9000 6 лет назад

    Thank you for this video.

  • @TheHrt07
    @TheHrt07 7 лет назад

    Nice Explanation.

  • @jonathanelkins
    @jonathanelkins 3 года назад +1

    Far from mediocre, this video is cool.

  • @safekalpa
    @safekalpa 5 лет назад

    Great work Thank you

  • @taherhekmatfar795
    @taherhekmatfar795 5 лет назад

    Thanks, so simple, so helpfull

  • @where-is-my-mind.
    @where-is-my-mind. Год назад

    8:20 You don't actually need Service object in the Customer class. In fact, Your class is still somewhat dependent on the Service class since the constructor expects it as an argument to instantiate the Customer. A better approach would be to directly pass the service object as an argument to the method, e.g. viewCustService(Service s), and use it inside the method. This way, your class is not dependent on it, and solely viewCustService will expect it as an argument not your class. So even if there is a problem with the Service class, your Customer class will still instantiate perfectly but you may encounter an issue only when the viewCustService is called.

  • @TheFlyguy31
    @TheFlyguy31 6 лет назад

    'Pretty much' on the ball. Thank You

  • @kurtheimerman8267
    @kurtheimerman8267 2 года назад

    Good video. Thanks

  • @enlightenedone1633
    @enlightenedone1633 4 года назад

    Awesome explanation!

  • @andream4989
    @andream4989 4 года назад

    Love the page. Forgive me if I mistake you and I mean nothing by it but you sound like a black man and I love supporting and linking up with all coders but especially black coders ✊🏿✊🏾✊🏽✌🏾🙌🏾👍🏾
    Followed, I'll spread your videos!

  • @kelvinabryant
    @kelvinabryant 5 лет назад

    Great tutorial bro!

  • @mirazzaidi
    @mirazzaidi 5 лет назад

    Great explanation :)

  • @enriquea1054
    @enriquea1054 7 лет назад

    Nice to see the FL Studio logo :)

  • @8Staszek8
    @8Staszek8 6 лет назад +15

    Great! Thanks! Short and VERY helpfull !
    btw you sound little like Samuel L. Jackson :D

  • @kevinpatel5106
    @kevinpatel5106 4 года назад

    thank you for the video, it was helpful!

  • @mehmetalikarabulut1190
    @mehmetalikarabulut1190 5 лет назад +1

    Nice and simple explanation of DI. However a few remarks in terms of java best practices: "name" field should be defined "private" in Service class (encapsulation), and there is no use to return string from viewCustService method in your example (redundant) since you already print the service name inside the method. I believe explanation of complex issues should still follow the best/basic practices. Regards.

  • @Gorky25
    @Gorky25 7 лет назад +3

    Hi,
    this is the same as we call association right? When we have instance of some object in a class. For i.g.
    public Class Wheel {
    ....
    }
    public class Car {
    private Wheel wheel;
    }
    Is this the same as DI how you explain?
    I am learning Spring boot and there are many confusing things that that i learn in Java SE and EE (servlets, JSP,...)

  • @neerajkanojiya8098
    @neerajkanojiya8098 6 лет назад

    Finally doubt got cleared. Thanks

    • @lordgaulo6520
      @lordgaulo6520 6 лет назад

      iknr the name is so big and the concept is so small doubt just keeps creeping in on what it is even after three years

  • @thanhdong8066
    @thanhdong8066 3 года назад

    Thank you for explanation. It is easy to understand.

  • @abstraction7963
    @abstraction7963 5 лет назад

    This is the best video about DI, I have ever seen!!! Thank u, u explain this very,very good!

  • @a.yashwanth
    @a.yashwanth 4 года назад +2

    So basically instead of hardcoding object creation in classes you pass it to constructor as argument?

  • @444v2.0
    @444v2.0 5 лет назад +1

    Thank you. I've had so much trouble with this concept. I believe I understand it now.

  • @kingk818
    @kingk818 6 лет назад

    Thanks man.

  • @rahulmathew8713
    @rahulmathew8713 4 года назад

    Dependency Injection Lay Man Terms. A charging adapter with usb port has inverse dependency with pendrive. Direct dependency means only a pendrive can be plugged into the charging adapter. Usb (universal serial bus technology is called the interface) . The company that made the adapter exposed an interface. Pendrive making company injected the dependency which is the pendrive device. Since the charging adapter has reversed or inversed the dependency you can now plugin a mouse or a keyboard or anything to this adapter. Thats it

  • @UmpikLumpik
    @UmpikLumpik 2 года назад

    So in nutshell, it's passing an obj1 as a constructor argument to obj2, where object1 is an object's field of obj2.

  • @dimadarwish8480
    @dimadarwish8480 5 лет назад

    thank you

  • @trustingod0
    @trustingod0 5 лет назад

    I thought the reason for dependency injection was to allow us to change the dependency outside of the class. So as to promote decoupling. And you would use an interface to do this.

  • @shahzaiblashari7250
    @shahzaiblashari7250 5 лет назад

    Thanks

  • @jaysanprogramming6818
    @jaysanprogramming6818 4 года назад

    I didn't get it. First you used initializer statement to set the customer instance member. So each time you instanciate the class, you create a Service instance with the "coolservice" string. For each Customer instance you create a new Service instance with a similar string (or maybe same according to Java compiler optimization of strings litterals). This is different than using a static member initializer where each instance would share a single Service instance.
    Next, you move the Service instanciation out of the Customer class but you pass it to the constructor. In effect, its customer member is initialized with the external instance. So, in the end, the Customer class still references internally a Service instance as an instance member.
    I don't get how it is less coupled than at the beginning of your explanation. Could you elaborate more about that?

  • @andreslebon3869
    @andreslebon3869 5 лет назад

    thanks

  • @waeleldesoki1994
    @waeleldesoki1994 5 лет назад

    thank u

  • @Snigakid
    @Snigakid 6 лет назад

    Great! Thanks!

  • @ashutosh3858
    @ashutosh3858 5 лет назад

    cool service

  • @icanmakemusic362
    @icanmakemusic362 5 лет назад

    You still have an instance of Service in the Customer class as a member... isn't that still a dependency?

    • @lovelycode7173
      @lovelycode7173 5 лет назад +2

      Yes, however you're not initializing the dependency in that class. Rather you're passing it to a parameter in the constructor so you can set it outside of the scope of that object.

  • @lightningthebeast
    @lightningthebeast 5 лет назад

    So basically this is Aggregation ¿

  • @andreaaldrich4046
    @andreaaldrich4046 5 лет назад

    "mmmkay?"

  • @danvilela
    @danvilela 5 лет назад +5

    How is this a “feature” of frameworks? This is simple OOP..

    • @onyashed
      @onyashed 5 лет назад +2

      He is explaining the DI concept in OOP.

  • @JV-fm5ul
    @JV-fm5ul 4 года назад

    Name sounds daunting but it really is an easy topic if you look closely.

  • @falconheavy595
    @falconheavy595 2 года назад

    fei fei sun

  • @rexsam3134
    @rexsam3134 3 года назад

    Please zoom in

  • @AlexSpieslechner
    @AlexSpieslechner 5 лет назад +11

    good content. but I cant trust anyone with a light IDE theme. either you only work 10 minutes a day, or your retinas are completely burnt out at this point

    • @Cyecize
      @Cyecize 5 лет назад

      I find the dark theme really annoying and I feel that my eyes are more strained when I use it.
      And for the past 1 year I have been working 8 hours every day so there are exceptions I guess :D

  • @vivekvikramsingh7239
    @vivekvikramsingh7239 6 лет назад

    Nick Fury teaches OOP on RUclips?

  • @No_Direct_Translation
    @No_Direct_Translation 6 лет назад

    Not for 101 students

  • @NoHandle690
    @NoHandle690 6 лет назад

    wow, eclipse looks so poor in comparison to visual studio :)

  • @nadeemsadiq6975
    @nadeemsadiq6975 5 лет назад

    Worst

  • @securethebag1613
    @securethebag1613 5 лет назад +1

    7 mins into the video and I still dont know what dependency injection is 👎👎👎