@[email protected] to Programmer [email protected] • 1 year agoEveryone should have a tool-building factory factory factoryi.ibb.coimagemessage-square58fedilinkarrow-up1583arrow-down117
arrow-up1566arrow-down1imageEveryone should have a tool-building factory factory factoryi.ibb.co@[email protected] to Programmer [email protected] • 1 year agomessage-square58fedilink
minus-square@[email protected]linkfedilink2•1 year agoDo you write unit tests with objects mocked via interfaces? Or polymorphism via interfaces? Those are the main reasons to use DI.
minus-squareEthanlinkfedilink1•1 year agoI use various strategies depending on what seems appropriate, including the two you mention. I’ve never felt the lack of DI.
minus-square@[email protected]OPlinkfedilink1•1 year agoI guess I have to start calling function invocation with generic parameters, fancy names (like “dependency injection” ^^)
minus-square@qwioeuelink2•1 year agoRelevant: I also prefer the simpler explanation. https://www.jamesshore.com/v2/blog/2006/dependency-injection-demystified
minus-square@[email protected]linkfedilink2•edit-21 year agoAs I read somewhere: Dependency Injection is a 25-dollar term for a 5-cent concept.
Do you write unit tests with objects mocked via interfaces? Or polymorphism via interfaces? Those are the main reasons to use DI.
I use various strategies depending on what seems appropriate, including the two you mention. I’ve never felt the lack of DI.
I guess I have to start calling function invocation with generic parameters, fancy names (like “dependency injection” ^^)
Relevant:
I also prefer the simpler explanation.
https://www.jamesshore.com/v2/blog/2006/dependency-injection-demystified
As I read somewhere:
Yea that works too.