Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The biggest challenge of properly implementing DI is getting all classes with DEPENDENCIES moved to a COMPOSITION ROOT. When we accomplish this, we’ve already come a long way.
Even so, there are still some traps to look out for. A common mistake is to require all DEPENDENCIES to have a constructor with a particular signature. This normally originates from the desire to attain late binding so that DEPENDENCIES can be defined in an external configuration file and thereby changed without recompiling the application.