Before to be continue, I suggest that you should know about OOP Design Principles. If you do not any more, please take a look at this link before keep on reading this articles.
One of the design principles is “Dependency Inversion Principle”, it says 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 on abstractions.