3 ms·
I do use this pattern in some cases, but none of them would be technically justified if I were to do a clean rewrite. Being able to grab arbitrary instances of
by bob1029 5y ago
I do use this pattern in some cases, but none of them would be technically justified if I were to do a clean rewrite.
Being able to grab arbitrary instances of things at runtime is a superpower in my view. The ability to tolerate various "anti-patterns" in your codebase - even more so. Maintaining complex codebases over many years and developers sometimes requires these sorts of compromises.
- oaiey 5y agoThat is exactly the point why dynamic factories are okay but service locator is not. A dynamic factory has a purpose and typically a base type. It is not arbitrary or superpower.