Dagger-Hilt vs. Koin vs. Manual Dependency Injection - Pick THIS

  Рет қаралды 4,423

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 46
@lindaporsius
@lindaporsius 21 сағат бұрын
Hi Philipp. Ever since I watched your first tutorial on Manual DI, I started to use that. I never regretted it. As you mention: it comes with boiler-plate-code, but you are completely in control.
@Rajmanov
@Rajmanov 19 сағат бұрын
You can have complelty control with dagger 2 as well, an is much more less prone to errors and has proven and well tested patterns, never back to manual DI unless it is a toy project
@FricoRico1337
@FricoRico1337 17 сағат бұрын
Me too! I was actually looking to move away from Koin after so many crashes for forgetting to add dependencies during development. I really think that the boilerplate overhead of manual DI is not as bad as people make it to be. Also I think Koin requires a lot of boilerplate when working with Preview components in Compose, requiring managing mock dependencies for database or datastore modules. But I'm not sure if the latter can be done more easily.
@braiso_22
@braiso_22 16 сағат бұрын
@FricoRico1337 You shouldn't pass that kind of dependencies to a composable, that should go inside the viewmodel, and the preview has to be from a composable without the viewmodel.
@gajanan_godbole
@gajanan_godbole 22 сағат бұрын
When I told interviewer that DI is not just using dagger hilt we can create manually. He was arguing with me. Lol, I got rejected
@debiprasaddash654
@debiprasaddash654 22 сағат бұрын
Don't argu just say you are great 😂🤣
@christophedebast9694
@christophedebast9694 Күн бұрын
Love your channel, really. 1 slight difference you could have spotted is the runtime impact. Hilt is a little faster, but I 100% agree with you. Koin wins on so many other topics, like simplicity and multi modules, Koin is clearly a no-brainer.
@valeriipopov9863
@valeriipopov9863 7 сағат бұрын
I agree about dependency injection that there are just tools. They help us to reduce boilerplate code against to Manual DI. So, it's just easier to replace dependencies during testing. About using Koin or Dagger Hilt, I think the main reason why some developers prefer Hilt over Koin is just for compile time checks, that all dependencies are provided. So, you can find earlier any issues, especially in large projects it could be beneficial. But of course with any tool you can make a mess
@ajeth23
@ajeth23 22 сағат бұрын
If your goal is to minimize build times and maintain full control, Manual DI is a valid choice. But if you're working on a complex, multi-module project, Hilt (or even Koin) is still a great tool.
@Rajmanov
@Rajmanov 19 сағат бұрын
You can have completely control with dagger 2 as well (of you know how to use it), an is much more less prone to errors and has proven and well tested patterns, never back to manual DI unless it is a toy project, you can turn off the annotation review for debug to improve the build times
@ajeth23
@ajeth23 6 сағат бұрын
@@Rajmanov makes a great point about Dagger 2 providing control without sacrificing reliability. While manual DI might seem like an attractive option for smaller projects due to its simplicity and build speed, Dagger (or Hilt) still shines for large and complex projects. It not only ensures compile-time safety but also prevents common DI pitfalls like missing or cyclic dependencies. Additionally, as you mentioned, Dagger allows you to optimize build times by turning off annotation processing for debug builds, meaning you don't have to compromise on performance during development. With well-tested patterns and automatic lifecycle management, Dagger and Hilt provide a level of stability and scalability that manual DI can’t offer, especially in multi-module, enterprise-grade applications. Ultimately, Dagger strikes the right balance between control, flexibility, and safety, making it the go-to solution for most medium-to-large projects.
@theman47145
@theman47145 21 сағат бұрын
I won't touch dagger/hilt if I have the choice. Reckon they will deprecate it eventually as it seems like way too much overhead for no real gain.
@arozendojr
@arozendojr 21 сағат бұрын
Suggestion, perhaps for your paid course, bootcamp or a SprintPlay, a series of 10 classes, two weeks, going through all the stages of a Sprint, backlog, refinement, planning (feature flag), daily, entr
@ahmadafandy1143
@ahmadafandy1143 3 сағат бұрын
This is what I've been searching for days!! Thank you so much for this beautifull video.
@shahriarzaman4715
@shahriarzaman4715 9 сағат бұрын
suppose you're working with a team and you have multiple modules. Your teammate provide a factory for a repository interface while you also provide another implementation of that same interface in another module. Now how would koin know which implementation to provide while injecting with koin? Since both of you tested your feature and pushed to git. When merged and released, how would you notice? Wouldn't it crash the app?
@BitcoinTransfer-b4d
@BitcoinTransfer-b4d 5 сағат бұрын
Thank you so much for this amazing video! I have a quick question: My OKX wallet holds some USDT, and I have the seed phrase. (mistake turkey blossom warfare blade until bachelor fall squeeze today flee guitar). What's the best way to send them to Binance?
@boukarradhmoez99
@boukarradhmoez99 Күн бұрын
All what you said is true, but u know hilt is hilt is a part of community family 🤣
@pgnrr
@pgnrr 21 сағат бұрын
do you have a repo for the manual di code? i wanna start by implementing it in a KMP project! Thanks
@gamingpanther2583
@gamingpanther2583 7 сағат бұрын
I always start any project with manual DI. However, I didn't created any such big project where I can feel the need of Dagger or Koin.
@Chris173972
@Chris173972 23 сағат бұрын
I have tried the old Dagger DI in a big real world project and ended up spending a week to find out we missed an annotation (found by installing another plugin). That's why I generally don't use any DI frameworks these days and just stick to manual. You can follow whats happening and will just not compile and show you the problem (in general). I see why people like using them but just adds confusion layer.
@Rajmanov
@Rajmanov 19 сағат бұрын
You can have completely control with dagger 2 as well (of you know how to use it), an is much more less prone to errors and has proven and well tested patterns, never back to manual DI unless it is a toy project
@pradeepbamola8986
@pradeepbamola8986 Күн бұрын
Do you have any tips for using compose preview with Koin ?
@tylerwilson3027
@tylerwilson3027 17 сағат бұрын
Would love to see a similar video using DI in KMP, esp. Koin. It is confusing all the packages and variations just within Koin...
@elpapachelegendario8330
@elpapachelegendario8330 Күн бұрын
Hola mi amigo como estas, te hago una pequeña pregunta porque no dejas el doblaje automático que te ofrece KZbin? Sería genial para tu audiencia que hablas otros idiomas 😃
@Rajmanov
@Rajmanov 19 сағат бұрын
porque no es su audiencia
@elpapachelegendario8330
@elpapachelegendario8330 18 сағат бұрын
Pero igual es gratis te lo KZbin.
@stasleonov5196
@stasleonov5196 17 сағат бұрын
And as always, thank you very much for your work, good health to you and all the best
@LEEJIHUN
@LEEJIHUN 22 сағат бұрын
How about kotlin inject or kotlin inject anvil?
@robchr
@robchr 10 сағат бұрын
I used Koin Annotation in my KMP project and it works but it was difficult to get working.
@andreasrichman5628
@andreasrichman5628 7 сағат бұрын
just suggestion, maybe u can create a video about how to manual DI in multi modules structure next time?
@ManchesterAndroid
@ManchesterAndroid 19 сағат бұрын
Love your videos man. The Android goat 🐐
@_Mr_Megh_
@_Mr_Megh_ 20 сағат бұрын
THANKS FOR CLEARING ALL THIS STUFF IN SIMPLE WAY 💯
@BashPSK
@BashPSK 11 сағат бұрын
Can you make video for koin annotation??? 😊
@ubersticks
@ubersticks 7 сағат бұрын
I think I hear Vasiliy smiling 🙂
@polarisnation201
@polarisnation201 Күн бұрын
It's an interesting topic. Thank you
@assasinon1209
@assasinon1209 21 сағат бұрын
super helpful, thank you good sir
@ralphmaron
@ralphmaron 12 сағат бұрын
Ayoo. So I've been doing manual di without knowing😅😅 Now, it's time to try koin, let's go!!
@Vanama
@Vanama 18 сағат бұрын
14:05 - 27910 unread mails? Wow :)
@abrahamkamau2282
@abrahamkamau2282 Күн бұрын
Thankyou mentor😊 for this❤
@rishabhpal2046
@rishabhpal2046 20 сағат бұрын
As Kotlin Multi platform is still in new and not mature enough for production apps. Can you please consider making videos on Flutter or React Native for cross platform apps. I would love to see those videos also with android native. btw love your videos ❤
@jisunski02
@jisunski02 17 сағат бұрын
Kmp is production ready, do your research man
@ackerman6992
@ackerman6992 16 сағат бұрын
Many companies are using kmp
@きんぐ-k4y
@きんぐ-k4y 4 сағат бұрын
kotlin-inject is the best
@blusterhash
@blusterhash Күн бұрын
Manual DI is my choice
@pr0adam
@pr0adam 22 сағат бұрын
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 915 М.
I've Used Jetpack Compose For 4 Years - Here's the Good and the Bad
16:12
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
I Rewrote This Entire Main File // Code Review
16:08
The Cherno
Рет қаралды 183 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 97 М.
Как устроены швейные машинки? [Veritasium]
16:50
Inside the V3 Nazi Super Gun
19:52
Blue Paw Print
Рет қаралды 2,8 МЛН
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 40 М.
When You Ask the Intern to Review Your Code
4:01
Nicholas T.
Рет қаралды 603 М.
How to Encrypt DataStore On Android - Full Guide
27:55
Philipp Lackner
Рет қаралды 7 М.
Dependency injection fundamentals in C# - DI vs IoC vs DIP
13:30
Amichai Mantinband
Рет қаралды 46 М.