Padraic Brady has posted today about a subclass of the Zend_Loader package (in the Zend Framework) he had written up to handle Dependency Injections - it was submitted but ended up being replaced with a Zend_Di component instead.
I realised someone had proposed a novel new component called Zend_Di, and that small change was since accepted by Federico into his DI buster. This is a quick overview with very simple use cases - read the full proposal for even more gory details about your object innards using DI.
He talks about what DI (dependency injection) is and what it can be used for and includes a simple example set around a controller in the framework that uses the Zend_Di component to make a "mock Zend_Mail" that can be used in testing too. Examples of these sorts of tests (with PHPSpec) are included too.




