TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Was DI is dumb idea?

3 点作者 StokeMasterJack超过 2 年前

3 条评论

techdragon超过 2 年前
Well this at least makes it more clear what the heck they were intended to solve... since I&#x27;ve done the bulk of my career with Python I&#x27;ve been blissfully ignorant of such things. Coming to C# it was a rather abrupt discovery that so many things I would just do with metaprogramming via class constructor parameters and passing arguments into the class object at creation time, were being done via complex dependency injection as if more simple mechanisms weren&#x27;t available...<p>Good history lesson at least.
panny超过 2 年前
At least one early DI evangelist thinks so,<p><a href="https:&#x2F;&#x2F;paulhammant.com&#x2F;2018&#x2F;04&#x2F;10&#x2F;it-turns-out-we-didnt-need-dependency-injection-containers-after-all&#x2F;" rel="nofollow">https:&#x2F;&#x2F;paulhammant.com&#x2F;2018&#x2F;04&#x2F;10&#x2F;it-turns-out-we-didnt-nee...</a>
dith3r超过 2 年前
Function encapsulated as class. Dependencies passed via constructor. Single public method to execute &#x27;function&#x27;.<p>Di as a single class with cake pattern using lazy properties for defining injectable objects. The most important - main function as application entry point.