Reading.CleanArchitecture.DependencyInversion

The Dependency Inversion Principle (DIP) states that high level modules should not depend on low level modules; both should depend on abstractions. Abstractions should not depend on details. Details should depend upon abstractions.

flow without dependency inversion, main call high level functions, they call middle level functions, they call low level functions

DEPENDENCY INVERSION

blue color here is my remarks or how i understand dependency inversion

below example from the book also

high level functions call interface, so on the level of code we unbound dependency from implementation, i.e. ml1 on the figure 5.2.

At runtime, the interface doesn’t exist. HL1 simply calls F() within ML1.

This entry was posted in Без рубрики. Bookmark the permalink.