Dependency inversion(DI) principle - need some explanation
Dependency Iversion principle states:
High level modules should not depend upon low level modules. Both should
depend upon abstractions.
Abstractions should not depend upon details. Details should depend upon
abstractions.
I totally understand point 1, it is solved with Dependency injection or
Service Locator pattern, but what about point 2? I've been searching so
much for information about it, but it seems nobody is considering it
important, is it? I don't understand what they mean with 'Details' -
implementations of abstractions??
No comments:
Post a Comment