Re:Why and how to use service injection in Node.js
by jitl on Sunday October 31, 2021 @12:40PM
(#29058227)
“Dependency injection”, especially this kind implementation, is fancy words for “calling your functions with commonly used parameters”. The language itself provides function parameters as part of the syntax of functions. Isn’t it easier and more clear to pass a dependency as a function parameter rather than mocking global state?
[ Parent
| on HN ]
Re:Why and how to use service injection in Node.js
by bitwize on Sunday October 31, 2021 @02:04PM
(#29058932)
Have you ever worked in an enterprise environment? This kind of transformation happens all the time: <straightforward implementation> called <simple name> => <complicated implementation of same thing> called <fancy name> because <scalability, compliance, "best practice", or other BS reason>.