I was speaking to another developer the other day and he insisted that if a class needs an instance of another class it should always be passed in an 'Init' method and not in the constructor. I disagreed with him on this and thought I should clarify when I think a dependency should be passed.
There are 2 options when passing a dependency to a class:
<ol style="text-align: left;">Passing it as a parameter in the Create constructor.
Passing it in a separate 'Init' method after c
Weiterlesen...