> Any kind of injection of dependencies should be done via an explicit method/constructor parameter.
I would go further and always recommend manual DI - that is passing the objects and creating them in code rather than depending on some magic framework to do the job. That makes understanding / analyzing / fixing bugs a lot easier.
It's actually not that hard / boilerplate-y to do even in Java (which is what we do in our team).
I would go further and always recommend manual DI - that is passing the objects and creating them in code rather than depending on some magic framework to do the job. That makes understanding / analyzing / fixing bugs a lot easier.
It's actually not that hard / boilerplate-y to do even in Java (which is what we do in our team).