Dependency Injection Explained

Dependency Injection Explained

Amigoscode

6 лет назад

181,385 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@landocodes
@landocodes - 29.07.2023 02:56

This was a great watch. Good job!

Ответить
@_l4m35
@_l4m35 - 04.06.2023 14:17

Why did MailChimpEmailService Class get annotated with @Service but earlier EmailService Class didn't. Both were injected with ContactListService?

Ответить
@Ingat_Allah_Hati_Tenang
@Ingat_Allah_Hati_Tenang - 31.03.2023 05:22

Jazaakallah brother

Ответить
@fenfire3824
@fenfire3824 - 21.03.2023 19:52

In general i like that you make a video about this topic. But in detail i am missing some background. You say, it is complicated and a lot code to talk about.
But at least some core mechanics and ideas behind it, would be great to know.
I don't know how spring does its dependency injection, but i know from other framworks they did it more simple and easy.
There you can downsize it to a class register, which registrates all singleton classes and construct these at start.
This register is also able to get additional data from configuration files. Thats the basic idea behind it.
Of course how and what exactly different frameworks do differently can be quite a lot. But i think the idea behind it, is just a mechanism how to ensure, that these classes have always only one instance.
The Service Annotation helps the register to know, that this class needs to be part of the service registry. In some frameworks, you have to put your class in a service config file and do it manually, instead of an annotation.

Ответить
@nicolasgoosen5142
@nicolasgoosen5142 - 01.03.2023 13:35

Great intro, thank you!

Ответить
@dimuthmenikgama7829
@dimuthmenikgama7829 - 09.02.2023 08:16

You are a great teacher

Ответить
@elvenpath7
@elvenpath7 - 22.12.2022 02:02

Question: Does this thing actually make sense only when using Spring and alike frameworks ?

Ответить
@arielspalter7425
@arielspalter7425 - 16.12.2022 06:43

Excellent explanation. Clear and simple. Thanks!

Ответить
@Ash-so2sr
@Ash-so2sr - 26.11.2022 22:30

Why is it necessary to tag the method and the field and the dependency class if you are passing the value to the constructor already? Seems like the functions of the tags is to implement the singleton pattern and manage the lifecyle of the instance but the injecting is happening in the constructor, you didn't show how to instantiate the mailChimpEmailService what are we passing to it's construcror?

Ответить
@fredrickamoako
@fredrickamoako - 12.11.2022 14:32

very insightful, not what I'm looking for in syntax but the explanation is all that I need

Ответить
@ra1zoo
@ra1zoo - 11.11.2022 00:09

Really well explained! Thank you!

Ответить
@Alex-ti8lv
@Alex-ti8lv - 14.10.2022 22:26

Thanks! you explain how and what does this injection is doing so clearly! Subscribed!

Ответить
@TheEmolano
@TheEmolano - 30.09.2022 21:57

Dependency Injection is global variables on steroids

Ответить
@Itech6969
@Itech6969 - 27.09.2022 20:49

so what is the difference between Injection and Autowire?

Ответить
@Lelouchvv
@Lelouchvv - 04.09.2022 11:40

My English is bad. Can anyone explain to me why the title is Dependency Injection Explained instead of Explained Dependency Injection? Thank in advance

Ответить
@stacypavlenko801
@stacypavlenko801 - 09.08.2022 09:36

This explanation is awesome. Thank you!

Ответить
@ashimov1970
@ashimov1970 - 29.07.2022 11:16

ma sha Allah! 👍👏

Ответить
@rounakrai8187
@rounakrai8187 - 24.07.2022 03:59

Dependency injection is basically creating an object that, if its a service (aka usually only performs methods with static variables that dont change), then use that same object over and over again rather than creating new ones

Ответить
@TheTrace8
@TheTrace8 - 19.07.2022 17:33

Very helpful!

Ответить
@jasper5016
@jasper5016 - 18.07.2022 09:03

Can you please cover a special video on Junits and Mockito?

Ответить
@zaloaustine3141
@zaloaustine3141 - 11.07.2022 21:13

Great explanation good job

Ответить
@thisisme253
@thisisme253 - 15.05.2022 02:29

What if you wouldn't use @Inject? I have already used objects like this without writing @Inject on Spring boot but has worked for me.

Ответить
@Muhtadin
@Muhtadin - 08.05.2022 21:27

Do you recommend learning Guice? Do you Guice tutorials?

Ответить
@myoung-junkang4833
@myoung-junkang4833 - 28.04.2022 01:00

amazing

Ответить
@codemonkeesyoutube1205
@codemonkeesyoutube1205 - 21.04.2022 23:55

Dependency injection is mostly for changing environments. E.g. Development vs. production. The code will not have to be altered, and the resources will come from different services such as a database and if you are working in dev, you'll get the PostgreSQL service, and if your working in production you'll get the Oracle service.

Ответить
@AzawYah
@AzawYah - 07.04.2022 04:39

You explained this really well. Thank you.

Ответить
@user-yitao-climbing
@user-yitao-climbing - 01.04.2022 04:32

Best explanation I heard about the dependency injection. Bravo!

Ответить
@danielbroadby92
@danielbroadby92 - 13.03.2022 23:08

Subtitles come up with “penis’ injection” and I was wondering what I clicked on

Ответить
@jesuszagal2737
@jesuszagal2737 - 13.03.2022 00:33

Could you make a video about dependency inversion? please 🙏

Ответить
@baloney_sandwich
@baloney_sandwich - 04.02.2022 01:24

so your explanation is it's bad for mockito testing, garbage

Ответить
@merxxibeaucoup9093
@merxxibeaucoup9093 - 20.01.2022 23:00

thank you !

Ответить
@xtonetware5493
@xtonetware5493 - 10.01.2022 08:35

How do we specify the different lifetime scopes for our DI objects .

Ответить
@daironperezfrias7819
@daironperezfrias7819 - 06.01.2022 01:33

Genial curso ahora lo entiendo todo

Ответить
@gurituna
@gurituna - 23.12.2021 01:00

long and similar class names make difficult to chase video. It could have been more simple explanation

Ответить
@tarnum113
@tarnum113 - 21.12.2021 17:59

I am learning Java now after Javascript. The video is super helpful. Thank you!

Ответить
@nerminsehic4542
@nerminsehic4542 - 11.12.2021 05:54

Brilliant explanation! Well done

Ответить
@EchoVids2u
@EchoVids2u - 17.11.2021 01:31

Why did you write @Service for MailChimpEmailService but not for EmailService?

Ответить
@cheribgh275
@cheribgh275 - 16.09.2021 22:28

Nelson you’re awesome 👏🏻 you explain everything miraculously. Thanks 🙏🏻

Ответить
@dylandakota759
@dylandakota759 - 31.08.2021 19:47

Whats the difference between this and Singleton again

Ответить
@HiagoxX
@HiagoxX - 19.08.2021 12:26

I love you

Ответить
@abhishake5678
@abhishake5678 - 12.07.2021 18:59

Which ide and plugins?

Ответить
@annaphilips1502
@annaphilips1502 - 29.06.2021 03:27

Could you make one on Guice?

Ответить
@hassanwala4628
@hassanwala4628 - 07.06.2021 16:10

Very well explained !! Thank you

Ответить
@rabebnefzi6120
@rabebnefzi6120 - 22.04.2021 19:17

Thank you indid

Ответить
@muhammadsiddiqui9522
@muhammadsiddiqui9522 - 21.04.2021 09:25

Amazing. Thanks.

Ответить
@nsgirish
@nsgirish - 15.04.2021 08:24

Best Explanation sir

Ответить
@seba23571
@seba23571 - 05.04.2021 16:36

I speak Spanish, sorry if I have spelling mistakes.
I'm not sure but,I had understood.
i had understand instantiate a class with keyword new , this sentence what you do is use address in memory in memory stack and not heap.

Ответить
@Og74223
@Og74223 - 22.03.2021 02:28

Imagine you want to test your app with fakeapiservicegenerator where you implement an interface contract of 3 function like get user list ,remove an user, and generate a random user (from a fake random user list of let s say 4 e mail) to add that random e mail to the main list like you want to fill it with more user e-mail.
How can I create a new variable (lets say userRandom) and add it to the user list?

Ответить