Integrating Symfony Dependency Injection Service Container with Zend Framework

      Comments Off on Integrating Symfony Dependency Injection Service Container with Zend Framework

In a new post to my blog, I discuss about integrating Symfony Dependency Injection Service Container with Zend Framework. Dependency Injection is an Inversion of Control specific pattern highly used and encouraged throughout Zend Framework implementation. A Dependency Injection container manages your services life-cycle, it is in charge of their instantiation, configuration and injection as shared instances: no more need to use static methods, singletons or factories for your services!

Here’s an example of what you could achieve after reading my series of posts:

  • Declare your services with a simple @Service annotation and configure their dependencies with @Inject annotation:

  • Then inject your services into your controllers:

Enjoy!