|
|
|
|
|
by irahul
5100 days ago
|
|
Injection by parameters(setters, constructor and simple params) has been in use much before DI became a fad. void qsort(void *base, size_t nmemb, size_t size,
int(*compar)(const void *, const void *))
Here, `compar` is being injected. When it is needed, it's sweet. But when you start going down Java's way(i.e the way Java frameworks (over)do it), it's irritating. The point of DI is to inject dependencies rather than hard coding them. That doesn't mean you have to use IoC containers, or you have to inject everything. |
|