Skip to main content
2 of 4
Clarification of some terms (use of full terms), added links to references and general question formatting

Open Close Principle (OCP) vs Dependency Inversion Principle (DIP)

I was trying to understand the difference between Open Closed Principle (OCP) and Dependency Inversion Princible (DIP).

Based on the R&D on internet so far, I came to the conclusion that 'DIP is one option through which we can achieve OCP'.

I'm I right on this ?

Can you give me an example which doesn't follow DIP but follows OCP ?

Jitendar
  • 381
  • 1
  • 2
  • 10