Re:Google’s Wire: Automated Dependency Injection in Go
by camdenreslink on Saturday February 18, 2023 @07:29PM
(#34852730)
This has not been my experience with dependency injection frameworks in C# at all. You know what happens in a large code base when you tell all of the developers to do manual dependency injection? They don’t do it and instantiate their dependencies in the constructor because it’s easier.
[ Parent
| on HN ]
Re:Google’s Wire: Automated Dependency Injection in Go
by drunkenmagician on Sunday February 19, 2023 @03:37AM
(#34855675)
So deterministic instantiation then, which I as a (predominately C#, currently) developer actually prefer - I find it much easier to follow unfamiliar code. But whatever work for your team ...
Re:Google’s Wire: Automated Dependency Injection in Go
by cgdub on Sunday February 19, 2023 @07:48AM
(#34857161)
I work in a large code base where we've told all of the developers to use dependency injection frameworks.
We are now using a mixture of 3 different dependency injection frameworks, manual dependency injection, and instantiating dependencies in the constructor.
Re:Google’s Wire: Automated Dependency Injection in Go
by za3faran on Sunday February 19, 2023 @11:04PM
(#34864801)
How is that a problem with DI, instead of a problem with the engineering team not enforcing coding guidelines and libraries?
Re:Google’s Wire: Automated Dependency Injection in Go
by mrkeen on Sunday February 19, 2023 @01:27PM
(#34860333)
I'd prefer what you describe, because I would still be allowed to fix it (change it to manual DI).
I usually write manual DI when I want to iterate on the system and make sure each part does what it's supposed to.
Then once it works I convert it to Joe Armstrong's gorilla-holding-the-banana-and-the-whole-jungle (framework DI) so it gets past code review, and I hope to never touch it again.