What is Dependency Inversion ?
It defines that both high level and low level interface depend on Abstraction layer.
In normal scenario: High level interface depends upon low level interface but this principal tell that both interface should depend upon on abstraction.
Dependency Inversion is a principle in object-oriented programming that suggests depending on abstractions rather than concrete implementations. It promotes loose coupling between classes and allows for easier extensibility and flexibility in the code base.
Advantage:
Example: Factory Design pattern is perfect example to explain “Dependency Inversion”