Besides checking, what is the big advantage of using DI (and I'm not talking about the structure of DI or IoC) over static classes? In particular, for an application in which you know that the service will not be replaced.
In one of our C # applications, our team uses Injection Dependency in the web GUI, service level, and repository layer instead of using static methods. Previously, we would have POCOs (entity objects of business objects) that were created, modified, transferred, and stored by static classes.
For example, in the past we could write:
CreditEntity creditObj = CreditEntityManager.GetCredit(customerId);
Decimal creditScore = CreditEntityManager.CalculateScore(creditObj);
return creditScore;
Now, with DI, the same code will be:
//not shown, _creditService instantiation/injection in c-tors
CreditEntity creditObj = _creditService.GetCredit(customerId);
Decimal creditScore = _creditService.CalculateScore(creditObj);
return creditScore;
, , , , , ( , ). , - ( /-/etc), concurrency, using(...) .