Setter Injection

    12 August 2014

    In my last post, I explained some of the differences between Dependency Injection (DI) and the factory pattern. I also gave an example of how constructor injection could be used to leverage the DI framework's ability to manage dependencies of dependencies. While constructor injection is my personal preferred way of doing it, there is an alternative. You could also use setter injection.