The popular "PHP The Right Way" site has added a new section about a technology that's already in wide use across PHP frameworks and other applications in the community - Dependency Injection.
Dependency Injection is providing a component with it's dependencies either through constructor injection, method calls or the setting of properties. It is that simple. [...] If you have ever read about Dependency Injection then you have probably seen the terms "Inversion of Control" or "Dependency Inversion Principle". These are the complex problems that Dependency Injection solves.
The new section talks about some of the fundamentals behind the use of DI (dependency injection), what the "Inversion of Control" and "Dependency Inversion Principle" are and a bit about a common implementation - dependency injection containers.
Link: http://www.phptherightway.com/#dependency_injection
没有评论:
发表评论