开发者

What does 'dependency injection' solve in PHP? [duplicate]

This question already has answers here: 开发者_Python百科 Closed 11 years ago.

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜