S
S
Sergey2016-01-30 17:35:36
OOP
Sergey, 2016-01-30 17:35:36

Inversion of Control vs Dependency Inversion?

How is the Inversion of Control (IoC) principle different from the Dependency Inversion Principle (DIP)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pi314, 2016-01-31
@sergyx

These principles simply refer to different things. IoC offers a way to organize flow control in the system (who calls whom, why and when), while DIP suggests following a certain direction when organizing dependencies (between modules), based on the level of abstraction of these.
In general, both of them are aimed at improving the qualitative characteristics of the system (and this is really common in them, as in all other OOD principles), only one "approaches the problem" from the behavioral aspects of the system, and the second - from the structural ones .

L
lega, 2016-01-30
@lega

DI is a special case of IoC, with IoC you need to call / get the necessary "components" yourself when DI supplies them to you, for example, as parameters in functions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question