Z
Z
zlodiak2019-05-30 13:51:26
Design patterns
zlodiak, 2019-05-30 13:51:26

Is there a difference between IoC and DI?

Can you please tell me if there is a difference between the dependency inversion principle and the "dependency injection" pattern?
Doubts arise because both do the same thing - add one object to another based on the interface. As a result of this, code cohesion is reduced because any object can be passed, as long as it conforms to a specific interface.
However, in many articles this method of reducing connectivity is called differently, and often within the same article.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Decadal, 2019-05-30
@Decadal

IoC is more general than DI. DI is a special case of IoC.
https://stackoverflow.com/questions/6550700/invers...

A
Alexander Taratin, 2020-09-22
@Taraflex

sergeyteplyakov.blogspot.com/2014/11/di-vs-dip-vs-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question