title: Dependency Injection Container vs Registry pattern
body: <p>I understand that the Dependency Injection principle is all about decoupling code. Instead of making <strong>new</strong> instances in the classes, instead you inject them, which make them 
  loosely coupled.</p>
  
  <p>Now if I have to pass on a set of objects that will be used through several classes throughout my application, I can make a container (commonly called dependency injection container).</p>
  
  <p>That is exactly what i am doing because I have to pass a config object, a logger object, a translator object, etc. which will be used through several classes instances of my application. I am passing the whole container through several classes, even if not all of the classes need access to all the objects within the container. This led me to the following question: what is the difference if I create a global Registry and put the objects in there, then retrieve them like Registry::getInstance()->get('logger'); ? Wether I use a global registry or a dependency container, class isntances will have access to all the objects within the container or registry, even if they don't need to see/access all of them.</p>
  
  <p>Conclusion: What is the difference if I pass a dependency injection container along my classes or a global Registry ?</p>