There seems to be increasing talk abotu dependency injection so I've been reading about it, this is in particular is a superb article about it. I'm still not 100% sold on it for our application though for a few reasons:
- I find the service locator and registry approaches just as testable and a good deal simpler.
- We don't really want to be doing some of the clever things that DI would allow, such as using the decorator pattern for repositories and then adding in functionality by reconfiguring.
Still its a great topic and anything Oren writes is worth reading.Fowlers original article on it is also obviously worth a look.