Hacker News new | ask | show | jobs
by sharpercoder 2051 days ago
That multiple usages of the same concrete types requires changes on multiple places. For small programs, the di container itself can probably be skipped (i.e. instantiate an object graph by newing up). For larger programs, this is too cumbersome and therefore error-inducing.
1 comments

> That multiple usages of the same concrete types requires changes on multiple places

Write a util function then, or like some like to call it, one of the many Factory pattern.

So then you’re writing your own one-off DI of sorts. And you have more code to write than if you’d just used DI.