Dependency Injection and Control Inversion - Terminology

In functional programming, functions are treated as entities and can be transferred because objects are in the context of OO.

At some level, a function can be called with some arguments.

And I was wondering: is this also called Injection Dependency?

And further: does this use of DI lead to inversion of control?

+2
source share
1 answer

Dependency Injection is a concept.

You can "implement" DI in functional languages ​​using this (ability to pass functions as parameters). There can be many ways to achieve DI, and each language can have its own ways to implement DI.

DI is a specialized form of IoC. Thus, all DIs are IoC, but not vice versa. Therefore, you are right in saying that this use of DI leads to IoC.

+5
source

All Articles