Dependency Injection Smells

A session at Dutch PHP Conference 2013

Friday 7th June, 2013

2:30pm to 3:15pm (AMT)

With the rise of dependency injection (DI) containers, which may or may not also be service locators, it is now very easy to keep track of all the dependencies of your classes and to switch between implementations. The temptation of using the new operator has since become much smaller. Still, all the options of the containers and locators, the syntax of the service definitions and lack of knowledge about design patterns related to dependency injection have resulted in some bad dependency injection design practices.

In this talk I will describe a couple of very recognizable and also very well fixable Dependency Injection Smells. After showing a code fragment which contains one of these DI smells, I will continue to work out different scenarios in which the situation gets out of hand and the smell becomes too bad. A solution then comes from existing design patterns and some general design principles.

About the speaker

This person is speaking at this event.
Matthias Noback

PHP & Symfony2 developer, living in Zeist (The Netherlands) with my girlfriend and son. bio from Twitter

Sign in to add slides, notes or videos to this session

Tell your friends!


Time 2:30pm3:15pm AMT

Date Fri 7th June 2013

Short URL


View the schedule


See something wrong?

Report an issue with this session