Wednesday, June 26, 2019

symfony - What does 'dependency injection' solve in PHP?





Possible Duplicate:
What is dependency injection?







What is the hipe around 'dependency injection' adapted from Java and introduced in Symfony 2? Could someone give an example of a problem and a solution with and without a dependency injection?


Answer



Explanation that fits to PHP: http://fabien.potencier.org/article/11/what-is-dependency-injection



BTW: It's not from Java world only. DI and variations of DIC are used in most of high level programming languages. It's an universal practice helping you to write more maintanable code.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...