Re:TDD Doesn't Force Good Design
by Tainnor on Tuesday September 05, 2023 @05:31AM
(#37389645)
You don't have to inject every dependency. If it's essentially a pure function, then just call that function (despite what old-school Java advocates, free functions not tied to any object are fine).
I like dependency injection for things which have state and/or do IO and/or are expensive to construct.
I like dependency injection for things which have state and/or do IO and/or are expensive to construct.