title: What exactly is Inversion of Control
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3058/what-is-inversion-of-control">What is Inversion of Control?</a>  </p>
  </blockquote>
  
  
  
  <p>I understand what Dependency Injection (DI) is (I think!). It's basically the satisfying of dependencies that an object may have. I try to think of the code I write when using DI as service oriented and I define my code as using other services.</p>
  
  <p>However, I'm currently wondering what it is exactly that we're inverting the control of, when using IoC. It's a fairly vague term and it could mean a couple of things.</p>
  
  <p>But, I think it's the responsibility of creating the object (and therefore satisfying dependencies using DI) which is handled by the IoC framework.</p>
  
  <p>It is still the responsibility of the application to ask for objects (ie - services) that it uses, the distinction being that it doesn't know (or care) how to create it. So, why is service locator considered an anti-pattern if all it's doing is asking for a service?</p>
  
  <p>Have I got that correct? Or does it mean something else. Also, have I got the responsibilities of DI and IoC separated correctly? If I have then an IoC framework cannot function without a DI framework. Or is DI just a feature of IoC frameworks?</p>