Skip to content

Commit 0c96e51

Browse files
Resources about Inversion of Control
1 parent a6bdc69 commit 0c96e51

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed
Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
# Tell me about Inversion of Control and how it improves the design of code
1+
# Inversion of Control
22

3-
## [Krzysztof Grzybek](https://github.com/krzysztof-grzybek)
3+
## Links
44

5-
Inversion of Control is a pattern in which we reverse the relation of the code execution: we don't call the external code, external code calls our code.
6-
E.g. when working we libraries, we usually import some module and call functions from that module. When working with frameworks, our custom code
7-
is called by the framework code. This is also known as the Hollywood Principle - "Don't call us, we'll call you".
8-
It may help keeping single responsibility of the specific classes and design more concise API's.
5+
* [InversionOfControl - Fowler](https://martinfowler.com/bliki/InversionOfControl.html)
6+
* [Inversion of Control Containers and the Dependency Injection pattern - Fowler](https://martinfowler.com/articles/injection.html)
7+
* [Inversion of Control Containers and the Dependency Injection pattern - Fowler](https://martinfowler.com/articles/injection.html)
8+
* [DIP in the Wild - Brett L. Schuchert](https://martinfowler.com/articles/dipInTheWild.html)
9+
10+
## Related topics
11+
12+
* Topics that might be confused with each other
13+
- Inversion of Control
14+
- Dependency Inversion Principle (from SOLID)
15+
- Dependency Injection
16+
17+
They are all related, but in fact separate.
18+
19+
### Relation with Hollywood Principle
20+
For some the Hollywood Principle (or Law) is just a synonym of Inversion of Control; some others see subtle differences. See [Confusion between Inversion of Control and Hollywood Principle](https://stackoverflow.com/questions/43786221/confusion-between-inversion-of-control-and-hollywood-principle).
21+
22+
In this context, another related topic is the difference between libraries and frameworks, as it is stated that frameworks follow the Hollywood Principle (see [What is the difference between a framework and a library?](https://stackoverflow.com/questions/148747/what-is-the-difference-between-a-framework-and-a-library)).

0 commit comments

Comments
 (0)