3 ms·
What you’re describing is generally good coding practice. But not, I don’t think, what people associate with DI.
by rco8786 1y ago
What you’re describing is generally good coding practice. But not, I don’t think, what people associate with DI.
- jillesvangurp 1y agoI think people's associations might be wrong then. In general, people seem to have a lot of misconceptions about DI. Like needing frameworks. Basically by inverting control of what initializes code, you create a hard separation between glue code and logic. Any logic that initializes code would violate that principle. You inject your dependencies because you are not allowed to create them yourself. And yes, that is good coding practice. That kind of was my point.
- rco8786 1y ago> I think people's associations might be wrong then I don't disagree, just that when talking about any given subject having an understanding of how the audience already thinks about that subject is somewhat important. The bigger better goal here is probably to try and get folks to internally separate DI as a pattern from DI/IOC frameworks.