All Questions
2 questions
3
votes
4
answers
2k
views
Dependency injection using method injection vs constructor injection
Where should I inject the dependency when I write a class? Should it be given to __init__ or to the specific method that uses the dependent object?
Take the below two pieces of code for example, to me ...
3
votes
4
answers
1k
views
Representing complex object dependencies
I have several classes with a reasonably complex (but acyclic) dependency graph. All the dependencies are of the form: class X instance contains an attribute of class Y. All such attributes are set ...