from my class I include all dependencies in the constructor.
to decide which dependencies to pass what rules should I follow?
when I decide to use the parameters of a method instead of the constructor?.
Concrete example.
I have a service that perform a operation on DB. To do this it must have 3 class repositories that injected via constructor and two parameter l'object of the db and a structure of data input
class Foo(Repo1, Repo2, Repo3)
{
function doSomething(objectToDB, objectInputData);
}
before posting I had put everything in the constructor. But then I had strong doubts and decided to ask
Is the question more complete? Thank you