Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why so many terms to say the same thing? IoC and DIP

IoC = Inversion Of Control

DIP = Dependency Inversion Principle (D in S.O.L.I.D.)

IoC == DIP? I think so, is true.

The world of building software is already so messy, why so many words to say the same thing?

(I know DI (Dependency Injection) and it is different of DIP and IoC)

Update:

According to the answers, then we can say that: (DI) + (IoC) = (Dependency Inversion Principle) ?

like image 317
Acaz Souza Avatar asked Sep 08 '25 16:09

Acaz Souza


1 Answers

Inversion of Control is the generic term. Dependency Injection is a specific type of IoC.

See Inversion of Control Containers and the Dependency Injection pattern.

The Dependency Inversion Principle is a guideline, while the other terms are descriptive of techniques. (IoC can be used to describe a principle as well, so this can be confusing.)

Used in a sentence:

Sue followed the Dependency Inversion Principle by using Dependency Injection in the constructor of her class and creating instances with an Inversion of Control container.

Update:

I do not feel that (DI) + (IoC) = (Dependency Inversion Principle) is accurate. That's like saying (Apple) + (Food) = (Good Nutrition). Each term has a specific meaning.

like image 189
TrueWill Avatar answered Sep 10 '25 07:09

TrueWill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!