title: What is mean by "Abstractions should not depend on details. Details should depend on abstractions" in Dependency inversion principle[DIP] means?
body: <p>Before asking this question I like to say that <a href="https://stackoverflow.com/questions/1710005/abstractions-should-not-depend-upon-details-details-should-depend-upon-abstract">this</a> question in stackoverflow is very similar to my question but still the concept is not clear very confusing. </p>
  
  <p>I am trying to understand the dependency inversion principle but I could not able to understand it completely? </p>
  
  <p>The below are two point which DIP says</p>
  
  <blockquote>
    <p>A. High-level modules should not depend on low-level modules. Both
    should depend on abstractions. B. Abstractions should not depend on
    details. Details should depend on abstractions.</p>
  </blockquote>
  
  <p>I can able to grasp the first point but I cannot able to get the second point, its look like both are same. After lots of search in stackoverflow &amp; other sites I can able to understand both are trying to say different thing but I could not able to get it.  </p>
  
  <p>Let’s consider an example:</p>
  
  <p>Let’s consider SalaryCalculator class [High level module] which is used to calculate the salary of employee. Which uses BonusCalculator [High level module] to calculate the salary as shown below. Since SalaryCalculator is using BonusCalculator it’s violating the first point of <strong><em>“High-level modules should not depend on low-level modules. Both should depend on abstractions”.</em></strong></p>
  
  <p><a href="https://i.stack.imgur.com/CoZSB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CoZSB.png" alt="enter image description here"></a></p>
  
  <p>So we introduced abstraction between both as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/qPFF9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qPFF9.png" alt="enter image description here"></a></p>
  
  <p>Here details [Low &amp; High level Modules] is dependent on Abstraction &amp; abstraction is not dependent on details. So in DIP what that second point is trying to tell? 
     <strong>If both are same why it is made as two points?</strong></p>
  
  <p><strong>If some one gives me an code example</strong> , that will be very useful.</p>