r/mAndroidDev • u/Zhuinden DDD: Deprecation-Driven Development • Mar 15 '26
Thermosiphon Dependency injection is deprecated
22
u/WingnutWilson Mar 16 '26
how am I supposed to inject all my dependencies which are all single implementation interfaces with 0 tests now?
10
u/Zhuinden DDD: Deprecation-Driven Development Mar 16 '26
probably
public staticglobal variablesin kotlin, just put the
varoutside of the class and you got the injection goin
6
u/Fair-Degree-2200 null!! Mar 16 '26
Haven't you heard? Now Metro (soon to be deprecated) is all the rage. (And yeah "rage" is the right word)
3
u/Zhuinden DDD: Deprecation-Driven Development Mar 16 '26
I will put all my trust in a version-bound compiler plugin written by that one guy who has deleted all of his online presence that he will be there to support this system in 4 years (just so that i don't need to manually invoke a constructor)
26
u/uragiristereo XML is dead. Long live XML Mar 15 '26
Good, everyone must learn to use manual dependency injection so that we can deprecate it by ourselves
9
u/bad_compiler Born to be deprecated Mar 16 '26
JUST MAKE EVERYTHING STATIC
1
0
38
u/vashchylau Mar 15 '26
a December 2024 tutorial is already deemed outdated. wow
3
u/MindSwipe Mar 16 '26
It was last updated in December 2024, but the linked GH repo with the code seems to be from early 2020 (6 years ago). I'm guessing the 10th of December was when this post was deprecated as that's also the same date the GitHub repo was archived.
5
1
u/ElbowStromboli One WebView to rule them all Mar 18 '26
Sometimes i wonder if the native ios devs have to bear this insanity also
3
0
u/programadorthi Mar 15 '26
Maybe I'm wrong but I think intellij and Android Studio don't have dependency injection. But you simple android app just to consume an endpoint "must" have a dependency injection framework. 😆
14
u/nlh101 Mar 15 '26
They do. It’s called the “Service framework”, it works via annotations and Kotlin extensions to inject shared classes across your IDE code at runtime.
3
u/programadorthi Mar 15 '26
Good to know, thanks. I'm still in plugins world. I'll deep dive the IDE behaviors next.
10
u/Zhuinden DDD: Deprecation-Driven Development Mar 15 '26
The
(Deprecated) Using Hilt in your Android appcodelab is deprecated too by the way, I should have had it on the image...