Re:The Problem with Dependency Injection Frameworks
by rr808 on Sunday January 08, 2023 @05:53PM
(#34304222)
The alternative of wiring up your own dependencies is pretty trivial and I really prefer it. Martin Fowler calls it a Service Locator, https://martinfowler.com/articles/injection.html#UsingAServi...
[ Parent
| on HN ]
Re:The Problem with Dependency Injection Frameworks
by throwaway_au_1 on Sunday January 08, 2023 @06:18PM
(#34304453)
FWIW a fellow who has published books on the topic calls Service Locator an anti-pattern[1]. I take no position here as usage of any pattern is contextual but it's worth a read.
[1] https://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Patt...
Re:The Problem with Dependency Injection Frameworks
by rr808 on Sunday January 08, 2023 @09:31PM
(#34306005)
Looks like a strawman, that isn't the ServiceLocator I expect, it looks like he's writing his own DI engine.
Re:The Problem with Dependency Injection Frameworks
by molszanski on Monday January 09, 2023 @09:46AM
(#34310867)
I would prefer manual DI:
https://blog.ploeh.dk/2012/11/06/WhentouseaDIContainer/