Learn Dependency Injection and Write Better Code

  Рет қаралды 165,234

Amigoscode

Amigoscode

Күн бұрын

Dependency Injection is a concept that you need to master. It helps to write code that scales and code that can be tested.
Register your interested for bootcamp here: amigoscode.hopp.to/bootcamp-r...
#amigoscode #dependencyinjection #java
Don't Forget to
===========================================
💯 Subscribe to Amigoscode - bit.ly/2HpF5V8
💯 Courses Available for free here - amigoscode.com/courses
💯 Join Private Facebook Group and Discord - amigoscode.com/p/join-community
⭐ Table Of Contents ⭐
===========================================
00:00 - Intro
01:31 - Dependency Injection
21:15 - Outro
🙊 Here are the goods for all my videos video 🙊
► Recommended Books
===========================================
- Clean Code - amzn.to/2UGDPlX
- HTTP: The Definitive Guide - amzn.to/2JDVi8s
- Clean Architecture - amzn.to/2xOBNXW
► Computer and Monitor
===========================================
- New Apple MacBook Pro - amzn.to/3464Mmn
- Dell 27 INCH Ultrasharp U2719D Monitor - amzn.to/2xM3nW1
- Double Arm Stand Desk Mount - amzn.to/3aYKKfs
- USB C Hub Multiport Adapter - amzn.to/2Jz7NlL
► Camera Gear
=============================================
- Sony ILCE7M3B Full Frame Mirrorless Camera - amzn.to/346QIJn
- Sigma 16 mm F1.4 DC DN - amzn.to/2wbic3Q
- Sigma 33B965 30 mm F1.4 DC DC - amzn.to/39G37Fd
► IDE & Tools I use for coding 💻 🎒
===========================================
- ITerm
- VsCode
- GoLand
- IntelliJ Ultimate
- Sublime
P.S
===========================================
💯 Don't forget to subscribe | bit.ly/2HpF5V8
💯 Join Private Facebook Group and Discord - amigoscode.com/p/join-community
💯 Follow me on Instagram | bit.ly/2TSkA9w
❤️ Thanks for watching

Пікірлер: 145
@amigoscode
@amigoscode Жыл бұрын
Register your interested for Amigoscode bootcamp here: amigoscode.hopp.to/bootcamp-register-interest
@samuelflower226
@samuelflower226 Жыл бұрын
Can you please do a video on how to create a java resume or portfolio. Especially for a backed developer?
@michelchaghoury9629
@michelchaghoury9629 Жыл бұрын
Please can you make tutorials on DevOps, springboot BDD Testing, and more advanced topics and concepts, also how to do desktop app development with java
@JanardanMaithil
@JanardanMaithil Жыл бұрын
Thanks for the video. Loved the Intellij theme you have. Which one is it?
@flyingrecordofficial
@flyingrecordofficial Жыл бұрын
Salam Amigos
@contentparrot
@contentparrot Жыл бұрын
Walikomasalam, Thank you for not using the music brother. May Allah be please with you. ❤
@terrah33
@terrah33 Жыл бұрын
Just a mention for the viewers: at @17:50 a class cannot be annotated with @Bean since its scope is limited to methods. Usually we use @Bean annotation on methods in a class annotated with @Configuration when we use external dependencies to generate beans for them. On the other hand, in order to mark a class as a bean we use the @Component annotation, which is a stereotype annotation (like @Service, @Repository and @Controller).
@erickjhormanromero6905
@erickjhormanromero6905 Жыл бұрын
Good to had done this clarification may be a newbie in programming could have been a little confused
@mayureshghodke7183
@mayureshghodke7183 4 ай бұрын
@@erickjhormanromero6905 yeah....like me 😁...new in Spring
@victorbucci5760
@victorbucci5760 3 ай бұрын
Thanks for the info. I'm actually one of these newbies. I use quarkus but I'm still learning how things work under the hood.
@_freeworld
@_freeworld 8 күн бұрын
I'm an android developer and I needed to understand dependency injection, I think this video has given me an idea of when dependency inject is about.
@johnnya246
@johnnya246 Жыл бұрын
The best explanation of the dependency injection and the singleton pattern! Simple and to the point!
@erickjhormanromero6905
@erickjhormanromero6905 Жыл бұрын
He never explaind singleton design patten just mentioned it. 😃😃
@user-rl5pb5un2f
@user-rl5pb5un2f Жыл бұрын
Helpline📲📥⬆️ Questions can come in⬆️
@SoniaChavez-je7hq
@SoniaChavez-je7hq 2 ай бұрын
@erickjhormanromero6905 yes he did, indirectly he did when he said that with singleton a connection class was instantiated just once, correct me if I m wrong.
@Secretclaps
@Secretclaps Жыл бұрын
Amazing! best injection tutorial I saw until this point . The issue with injection is that is so simple it is hard to understand, it is something that comes naturally.
@ahmedbishree9429
@ahmedbishree9429 Жыл бұрын
Thanks bro again you nailed it, I've read a lot of books about the dependencies injections but I couldn't find what I was looking for, lastly I can get my head around it in this video. my ALLAH bless you
@bartex10101
@bartex10101 Жыл бұрын
I think that your explanation of dependency incjection in pure java is quite good. On the other hans I think you should say something about pross and cons of context dependency injection. There is some problems with it and it should not be used as remedy for everything. For example in huge applications when you have thousands of services etc. it may become bean hell where dependency tree will looks like spaghetti cause of beans flying everywhere. Another drawback is that if you make your class a singleton bean and this class (for example service) is used only from time to time it still wastes memory. Garbage collector can't collect it even if you stoped to use this class way ago. So people of java don't be afraid to instantiate objects with new () keyword! :D Sorry for mistakes, English language is not my native language ;)
@rafaelrosa3841
@rafaelrosa3841 Жыл бұрын
perfect.. people is very naive when coding with this patterns. And call the new operator of "bad code" is funny.
@henriquesenadev2194
@henriquesenadev2194 Жыл бұрын
Great comment
@eufraniodiogo50
@eufraniodiogo50 Жыл бұрын
Thanks, dude, for explaining to us that it's not the world saver and it could not be the best approach to take in all cases. Thanks, and about your English it's fine, it's not also my native language.
@Diego-Garcia
@Diego-Garcia Жыл бұрын
Now everything make sense!!! That's why people create an Interface for every class; that's why people assign every field inside the constructor. The Interfaces are created to decouple the "true" class, being able to pass other objects with the same signature, LIKE A MOCK CLASS.
@haihoangninh3237
@haihoangninh3237 Жыл бұрын
I've been stuck to this for days, thank you!
@Griefed_
@Griefed_ Жыл бұрын
Awesome video, thank you very much! Looking forward to the DI videos. I hope you give us a glimpse of manually doing singleton DI just to show us how it is done, in case one does not use Spring or something else.
@erickjhormanromero6905
@erickjhormanromero6905 Жыл бұрын
I don't know why you need this if Spring is one of the most used java framework and will do all for you. but check this. To achive that is just to check if there's already a instance on such dependecny to be injected in the constractor of the target class and return the same instance. kzbin.info/www/bejne/qoS9n2etoKd8q5o
@michailmarkou1995
@michailmarkou1995 Жыл бұрын
absolute amazing SOLID tutorial!
@jeff_tech
@jeff_tech Жыл бұрын
Thank you! You explained it very clearly
@jaymarkalvarez9851
@jaymarkalvarez9851 Жыл бұрын
You're amazing! Saying hi from the Philippines.
@kuchdarith
@kuchdarith Жыл бұрын
Wow, the best video for beginners. Thanks sir for your video, so sweet explants about the proccessing.
@RicardoSilvaTripcall
@RicardoSilvaTripcall Жыл бұрын
Amazing explanation, Congrats from Brazil !!!!
@franke1917
@franke1917 Ай бұрын
Very interesting and easy explanation! Thank you so much!
@kopilkaiser8991
@kopilkaiser8991 10 ай бұрын
Assalamwalaikum. Thank you for the video. May Allah bless you with all of His blessings. You are a great teacher and just learning from you is just so easy than from other resources 😊❤
@ahmaddawood9691
@ahmaddawood9691 Жыл бұрын
This is really excellent tutorial on dependency injection ..... thanks
@SiyaNtombela
@SiyaNtombela Жыл бұрын
Can't wait for the course to come out!
@SoniaChavez-je7hq
@SoniaChavez-je7hq 2 ай бұрын
It was easy to understand this idea with your explanation, thx
@kostiantynkarzhanov9216
@kostiantynkarzhanov9216 3 ай бұрын
Thank you so much! Fantastic explanation! 💛
@andrekreou1
@andrekreou1 Жыл бұрын
Just in time! I am writing my MSc thesis and this information is valuable!
@mad616
@mad616 Жыл бұрын
dependency injection is a bachelor 2. semester concept man 😶
@andiuptown1711
@andiuptown1711 Ай бұрын
@@mad616No it’s not lol
@paulo__vieira
@paulo__vieira Жыл бұрын
For those who wanna learn about Beans with details, I recommend the Spring Start Here book from Laur Spilca, it's an introductory book about Spring where the author use some analogies to explain about beans, it's quite interesting.
@alexisdona
@alexisdona 2 ай бұрын
Do you have it in digital format?
@andiuptown1711
@andiuptown1711 Ай бұрын
@@alexisdonasearch it on Reddit, I found it there!
@SerdarPolat21
@SerdarPolat21 Жыл бұрын
MashaAllah brother. You are talented. I'm learning from your videos. And I am adapting it to Dart language.
@thEstRonG3r
@thEstRonG3r Жыл бұрын
Just small thing, at 15:55, if HEAP is full, you will get OutOfMemoryError, and not StackOverflowError.
@pstlvictoras
@pstlvictoras Жыл бұрын
Subscribed! thank you sir!
@marzenalaaeddine
@marzenalaaeddine Жыл бұрын
Great, Baraka allahou fik.
@betultultay1615
@betultultay1615 6 ай бұрын
Great explanation thank you
@teachermartin8251
@teachermartin8251 Жыл бұрын
Awesome explanation of DI
@89Valkyrie
@89Valkyrie Жыл бұрын
Excellent explanation.
@nestoralmarza5732
@nestoralmarza5732 Жыл бұрын
great video! cyclic dependency is a great topic for a future video.
@amigoscode
@amigoscode Жыл бұрын
Good one actually
@xiaocatcat
@xiaocatcat Жыл бұрын
Hope you explain more about OOP. Thanks
@user-oq2zo5ki8c
@user-oq2zo5ki8c 7 ай бұрын
Wow, it's super helpful!
@JulianSloman
@JulianSloman Жыл бұрын
KZbin insists on showing me Java code... as a JavaScript developer - but big fan of dependency injection in general. Works in a functional context as well (i.e. split stuff in more functions, pass stuff needed as params rather than make "scope" do all the lifting) - then test the functions directly.
@mkanbu3802
@mkanbu3802 Жыл бұрын
Thank you so much sir. ❤️
@frodggy2714
@frodggy2714 Жыл бұрын
great video. keep it going brother.
@mariazinchyn
@mariazinchyn Жыл бұрын
Thank you!
@talbiabdelali5914
@talbiabdelali5914 Жыл бұрын
Thank you bro for all the content you bring toi us realy so helpful. I want just to Ask you to do more vidéo on java even the easiest Java topics it will be very for everyone. For exemple Can you make a vidéo about exceptions how jvm please bro!
@mohsenzahabipour40
@mohsenzahabipour40 Жыл бұрын
Great explanation 👌 Haji 😊
@joaosantos6868
@joaosantos6868 Жыл бұрын
Qual o tema e a fonte que você está usando? Ótimo conteúdo
@deltamakuba
@deltamakuba Жыл бұрын
Thank You brother
@world-observer3460
@world-observer3460 Жыл бұрын
The DI concept is confusing me for a while util i see this clip. Really good work Bro.
@kunnudev7250
@kunnudev7250 Жыл бұрын
Great thanks so much bro
@KailashJNirmal
@KailashJNirmal Жыл бұрын
Thanks for the tutorial Brother. Thanks for sharing . Your english so easy to understand. How do you record your video? Do you use some special device ? I liked your Java series .
@umitkirtil
@umitkirtil Жыл бұрын
thank you for great tips and concept topics like this. Asselamu aleikum
@user-rl5pb5un2f
@user-rl5pb5un2f Жыл бұрын
Helpline📲📥⬆️ Questions can come in⬆️.
@boristhedestroyerofancient508
@boristhedestroyerofancient508 Жыл бұрын
Based video - as always!
@yaphetb5717
@yaphetb5717 Жыл бұрын
Thanks for this video nelson✌. Can you cosider doing a video on payment integration in spring boot?
@johncarlo4028
@johncarlo4028 Жыл бұрын
So dependency injection is what's being used in MVP is it at Presenter to be specific? I am currently familiarizing my self to the patterns, and so far, i think patterns are awesome.
@jenaman0001
@jenaman0001 Жыл бұрын
Hi @Amigoscode, You have beautifully explained the DI. I have one question here. I am using DI using and have a situation like below public class Demo { private CarDAO carDao; private NewCar newCar; public Demo (CarDAO carDao){ this.carDao = carDao; newCar = new NewCar(this.carDao); } Can you please guide how to handle this situation ... without instantiating the newCar in the constructor..
@Dzikrullah_999
@Dzikrullah_999 Жыл бұрын
Jazakallah brother
@joseferreira7415
@joseferreira7415 10 ай бұрын
I had a doubt. In your Spring boot tutorials, @Autowired is not used. The class is annotated with @RequiredArgsConstructor and the dependency attributes are declared as final. In this video, I understood that @Autowired is used to inject the dependency instance that was found. Why is @Autowired not used in the construction of your Spring projects? Thank you for everything, I'm a big fan of yours!!
@alessiobino8248
@alessiobino8248 Жыл бұрын
great video !!
@MwauraXavier
@MwauraXavier Жыл бұрын
Perfection.
@hamzaa7335
@hamzaa7335 Жыл бұрын
Bro I love your Videos, where you learned this all?
@hamza_Techy
@hamza_Techy Жыл бұрын
Great!❤️
@VforVanish
@VforVanish Жыл бұрын
NestJS does the same thing! Good tutorial thanks!
@erickjhormanromero6905
@erickjhormanromero6905 Жыл бұрын
Angular too. remember nest is for Node
@xeyalteyyubov1175
@xeyalteyyubov1175 Жыл бұрын
Keep going.
@lrzero1362
@lrzero1362 Жыл бұрын
It's an awesome video, I just still have a small question, can you explain a little bit more what the purpose of the annotation @Autowire is. That's the only thing I'm still kinda confused about. Thank you in advance.
@borhan_sahed
@borhan_sahed Жыл бұрын
Assalamu alaikum brother. Your videos are too good. Will the bootcamp be available free of cost ?
@Ezzedini
@Ezzedini Жыл бұрын
is there a video after this to recommend to understand the rest of annotations in spring framework?
@KlanBr1
@KlanBr1 Жыл бұрын
great video. This video belongs to a playlist? in that case, what is the link of that list where you can find, for example, the video in which you talk about the annotations like the @Bean
@mohammadsaht5602
@mohammadsaht5602 Жыл бұрын
keep up my friend always check new videos
@willofd1683
@willofd1683 Жыл бұрын
HI! PLease which app are you using to make this schema? Thanks
@grzegorzmolin
@grzegorzmolin Жыл бұрын
Díky!
@hitstick567
@hitstick567 Жыл бұрын
Can you do a video on programminng to interfaces in Java?
@sharadsingh2856
@sharadsingh2856 11 ай бұрын
Awesome
@SeanCarter
@SeanCarter Жыл бұрын
What’s that lighting setup? The video is crispy.
@FilipCodes
@FilipCodes Жыл бұрын
Liked immediately
@ahmedbishree9429
@ahmedbishree9429 Жыл бұрын
Essalamo Aleykum bro is there any book that you can advise us with to get a deep understanding for the dependencies injection?
@YT-vx9sz
@YT-vx9sz Жыл бұрын
Bro I was just searching for a good video on this topic😂
@Kim-tr5op
@Kim-tr5op Жыл бұрын
do u have a vid about testing in spring?
@scottcooper6644
@scottcooper6644 Жыл бұрын
Legend
@bahmad2009
@bahmad2009 Жыл бұрын
Usssalaam vaaleykum 👍👌
@optimisticenigma283
@optimisticenigma283 Ай бұрын
Is this part of a course playlist, because I can't find the other videos he refers to when saying "earlier we talked about" or "we'll cover this later on". I genuinely liked the explanations and so was wondering where I can find the full playlist?
@kareem7236
@kareem7236 Жыл бұрын
Salam alikum Amigo , What should I now to be ready to start with Spring ? Pleas let me now 🤗
@zafarjonolimov2953
@zafarjonolimov2953 Жыл бұрын
Waalekum assalam...
@lxdzii
@lxdzii Жыл бұрын
is the boot-Camp free or? and also is it online? ....and if possible can @Amigoscode make a separate video explaining in a bit of depth how the boot-Camp will carry out, because i have a lot of questions about i have i am very much interested in joining
@pablo-2349
@pablo-2349 Жыл бұрын
its a good programing coure? sorry for bad englisch
@murrayKorir
@murrayKorir Жыл бұрын
If Spring boot was never invented I would never have continued and loved java.
@ElvinMayenCarrillo
@ElvinMayenCarrillo Жыл бұрын
I'm currently studying for a backend position and I need to learn dependency injection on python, currently trying to implement it on my own linked list with its own node class, could anyone provide an example or explain more or less how could I actually implement dependency injection?
@liledg2357
@liledg2357 Жыл бұрын
19:30 Do we really need to put either @Autowired or @Inject at the constructor? I thought spring sees the constructor argument and automatically injects the dependency
@tunamusic2314
@tunamusic2314 Жыл бұрын
yupp put autowired annotation so it can be automatically injected
@taneatrifon6627
@taneatrifon6627 9 ай бұрын
what's the previous video of this course?
@aoboyang8735
@aoboyang8735 Жыл бұрын
Is there a play list?
@thapelomorare1484
@thapelomorare1484 Жыл бұрын
Do Jsp and servlets
@Mrboo9413
@Mrboo9413 Жыл бұрын
May Allah reward you for those explanations.
@sanamudash4976
@sanamudash4976 Жыл бұрын
Make video on micro services
@VenkateshKamazg
@VenkateshKamazg Жыл бұрын
Its already there
@m5a1stuart83
@m5a1stuart83 Жыл бұрын
Waalaikum Salam brother
@mcgruff0972
@mcgruff0972 Жыл бұрын
Aren't you defeating the purpose of dependency injection by implementing with concrete implementations instead of interfaces, you still have a tightly coupled dependency? I haven't used @Bean so maybe this solves the problem.
@Aswodel
@Aswodel 3 ай бұрын
Where is the previous video before this? you say: "earlier in this course we..." is that video available on KZbin? Or do we need to pay? And if so, where?
@patrickigiraneza2947
@patrickigiraneza2947 Жыл бұрын
💡
@sportsuniverse1303
@sportsuniverse1303 Жыл бұрын
👍
@evgeniy_lukas
@evgeniy_lukas Жыл бұрын
Hi from Ukraine!
@user-kh6rp6yx1j
@user-kh6rp6yx1j 21 күн бұрын
وعليكم السلام ورحمة الله, الحمد لله.
@billszy794
@billszy794 Жыл бұрын
Wa lakim alsaalam
@luisuran4050
@luisuran4050 Жыл бұрын
What's with emo service?
@CarlosVera-jy7iy
@CarlosVera-jy7iy Жыл бұрын
Greetings amigos code, because I do not receive any information from the bootcamp to my email I have already registered
@hamednikbakht9708
@hamednikbakht9708 Жыл бұрын
hi please upload video from best way for read and write json file and mapping to requestClass and send for api
@erickjhormanromero6905
@erickjhormanromero6905 Жыл бұрын
Just create your json file as a resources , serialize it to a class using ObjectMapper or GSON, mapper to a DTO and then return it. or insted of using a DTO design patten just return using GSON
@SnehaJPai
@SnehaJPai Жыл бұрын
Then why do we use @Autowired annotation? How is it different from this scenario?
@lisafox9026
@lisafox9026 Ай бұрын
9:16 if Carservice has 10 fileds, it must be 10 parameters in condtructor?
@ivanivanov7617
@ivanivanov7617 Жыл бұрын
No need for @Autowired for the constructor because Spring is smart enough to do it for us except cases with multiple constructors.
Let's Review Your Backend Code | SHALL WE???
36:24
Amigoscode
Рет қаралды 299 М.
Spring Boot Tutorial | Full Course [2023] [NEW]
1:37:31
Amigoscode
Рет қаралды 2,6 МЛН
How To Choose Ramen Date Night 🍜
00:58
Jojo Sim
Рет қаралды 61 МЛН
The World's Fastest Cleaners
00:35
MrBeast
Рет қаралды 178 МЛН
10 Most Common Java Developer Mistakes
16:13
Amigoscode
Рет қаралды 100 М.
the right way to organise your code
17:33
Amigoscode
Рет қаралды 190 М.
JAVA DTO Pattern Tutorial | Simplify Your Code
19:12
Amigoscode
Рет қаралды 186 М.
Learn SOLID Principles with CLEAN CODE Examples
28:35
Amigoscode
Рет қаралды 257 М.
Learn How to Use Abstract Classes
17:28
Amigoscode
Рет қаралды 66 М.
Functional Programming with Java Streams API
50:00
Amigoscode
Рет қаралды 171 М.
10 Spring and Spring Boot Common Mistakes You Need To STOP
15:49
Amigoscode
Рет қаралды 137 М.
Dependency Injection
4:47
Anthony Ferrara
Рет қаралды 934 М.
Nokia 3310 versus Red Hot Ball
0:37
PressTube
Рет қаралды 1,9 МЛН
How Neuralink Works 🧠
0:28
Zack D. Films
Рет қаралды 31 МЛН
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 1,6 МЛН
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 42 МЛН