Dependency Inversion Principle

From JholJhapata
Revision as of 17:29, 16 August 2019 by Admin (talk | contribs) (Created page with "The Dependency Inversion Principle states that: # High-level modules should not depend on low-level modules. Both should depend on abstractions. # Abstractions should not depe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Dependency Inversion Principle states that:

  1. High-level modules should not depend on low-level modules. Both should depend on abstractions.
  2. Abstractions should not depend on details. Details should depend on abstractions.

Dependency inversion principle is one on which most of the design patterns are build upon. It's aim is to reduce the coupling between the classes is achieved by introducing abstraction between the layer, thus doesn’t care about the real implementation.

Dependency Inversion Principle Example