Friday 26 August 2016

php - Explanation Dependency Injection

Can anyone help me explaining in 'easy words'





  1. When should I use dependency injection.

  2. Why should I use it? ( Should I use it in combination OR not with MVC?)

  3. What does in it easy words ? How is it working

  4. Is it like creating a factory for recycling your code/scripts?

  5. How does it interact and how do I call it when I use a front-controler ( For example )



Those questions are already on stack, but I still have some problems understanding them.

So I am really looking for a simple explanation.



I currently set up my projects the following way ( Dummy )
http://pastebin.com/WJau2CyZ
And I have no clue how exact to implement DI.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...