3 ms·
One thing that I don't fully agree with is the treatment of Dependency Inversion. As I see it, the Dependency Inversion Principle (DIP) and Dependency Injection
by metanonsense 7y ago
One thing that I don't fully agree with is the treatment of Dependency Inversion. As I see it, the Dependency Inversion Principle (DIP) and Dependency Injection (DI) are quite different things living in different dimensions. While DI, as he describes, might be a good candidate to implement DIP, it is IMO by no means an example of DIP (unless I get the reasoning wrong). In my understanding, DI is all about keeping objects that interact with each other on the same layer of abstraction in order to avoid a semantic impedance mismatch. The eponymous "inversion" part is about how we get objects from different domains into the same abstraction layer: by defining an interface in the language of our own module and implementing this interface in the other module (or somewhere between).
Aside from that, I really like the idea of teaching abstract stuff with examples and counterexamples.