DigestCPP

Lets Understand With Example

  • Home
  • Design Principal
  • Design Patterns
  • C++ 11 Features
  • C++11 Multithreading
  • Contact Us

Dependency Inversion

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”

Primary Sidebar




DigestCPP © 2023. All rights reserved.

    About Privacy Policy Terms and Conditions Contact Us Disclaimer