fuck_u_spez@lemmy.fmhy.ml to Programmer Humor@programming.dev · 1 year agoEveryone should have a tool-building factory factory factoryi.ibb.coimagemessage-square41fedilinkarrow-up1180arrow-down15
arrow-up1175arrow-down1imageEveryone should have a tool-building factory factory factoryi.ibb.cofuck_u_spez@lemmy.fmhy.ml to Programmer Humor@programming.dev · 1 year agomessage-square41fedilink
minus-squaretatterdemalion@programming.devlinkfedilinkarrow-up0·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-squarefuck_u_spez@lemmy.fmhy.mlOPlinkfedilinkarrow-up3arrow-down1·1 year agoI guess I have to start calling function invocation with generic parameters, fancy names (like “dependency injection” ^^)
minus-squarematto@lemm.eelinkfedilinkarrow-up2·edit-21 year agoAs I read somewhere: Dependency Injection is a 25-dollar term for a 5-cent concept.
minus-squareqwioeue@lemmy.worldlinkfedilinkarrow-up1·1 year agoRelevant: I also prefer the simpler explanation. https://www.jamesshore.com/v2/blog/2006/dependency-injection-demystified
minus-squareEthan@programming.devlinkfedilinkarrow-up1·1 year agoI use various strategies depending on what seems appropriate, including the two you mention. I’ve never felt the lack of DI.
Do you write unit tests with objects mocked via interfaces? Or polymorphism via interfaces? Those are the main reasons to use DI.
I guess I have to start calling function invocation with generic parameters, fancy names (like “dependency injection” ^^)
As I read somewhere:
Relevant:
I also prefer the simpler explanation.
https://www.jamesshore.com/v2/blog/2006/dependency-injection-demystified
I use various strategies depending on what seems appropriate, including the two you mention. I’ve never felt the lack of DI.