Re:The Problem with Dependency Injection Frameworks
by revskill on Sunday January 08, 2023 @04:16PM
(#34303221)
At work, all of my function has at most 3 parameters: deps (dependencies), params (for parameters), ctx (for context), which covers all of my use cases, easy to test, debug, isolate.
[ Parent
| on HN ]
Re:The Problem with Dependency Injection Frameworks
by niux on Sunday January 08, 2023 @04:19PM
(#34303243)
Can you give an example of a function?
Re:The Problem with Dependency Injection Frameworks
by 0xb0565e487 on Sunday January 08, 2023 @04:23PM
(#34303287)
function something(deps, params, ctx) {
// put something here
}
Re:The Problem with Dependency Injection Frameworks
by jiggawatts on Sunday January 08, 2023 @05:33PM
(#34304031)
This is the equivalent of a relational database schema where there's only a couple of tables with columns such as: (EntityId,RowId,ColumnId,Value).
In very rare cases this type of design is required, but the key word here is "rare". It shouldn't be the norm for ordinary apps such as typical web apps! If you find yourself doing this type of thing regularly, then you've likely made some sort of mistake.
Re:The Problem with Dependency Injection Frameworks
by revskill on Sunday January 08, 2023 @05:40PM
(#34304098)
You're making assumption ?
The code is absolutely maintainable, simple by design, simple to test in isolation , simple to debug in isolation, simple to scale features, simple to replace,...
I'm not sure what you want more for a production-ready code.