Sunday, November 4, 2018

c# - Is this dependency injection?

Is this dependency injection if I change the below code



class Needer
{
Needed obj;
AnotherNeeded obj2;

public Needer()

{
obj = new Neede();
obj2 = new AnotherNeede();
}
}


To this code



class Needer

{
Needed obj;
AnotherNeeded obj2;

public Needer(Needed param1, AnotherNeeded param2)
{
obj = param1;
obj2 = param2;
}
}

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...