Proper Component Isolation with DIP

I think that anyone can agree that good code is S.O.L.I.D. code, and Dependency Inversion Principle (DIP) is a very important one.

The principle states that:
A. High-level modules should not depend on low-level modules. Both should depend
on abstractions.
B. Abstractions should not depend upon details. Details should depend upon

DIP is very useful when you want to isolate a more abstract type from it’s dependencies (details) by usage of interfaces which receive a concrete type via Dependency Injection pattern. So instead of having a direct dependency like this…


…you put an interface between the two components like this:


Noting too special until now but what about the physical location of the interface?

Continue reading