New answers tagged

2 votes

Please explain the "swapable dependency" arguments for IOC containers

Bullet point 1 The question isn't so much "how can I have multiple kinds of loggers in my runtime". The question is "across the entire lifetime of my codebase, how can I ensure that if ...
Flater's user avatar
  • 45.6k
3 votes

Passing data into Repository via dependency injection

Pagination information is usually passed as part of the request. Configuring this information in the DI container implies it is potentially shared state in the application, when in fact the usual use ...
Greg Burghardt's user avatar
8 votes
Accepted

Relevance of dependency Injection

So there was never the situation when I needed two different bindings for one interface. Polymorphism isn't the only reason to use Dependency Injection. DI lets you control what knows about what. ...
candied_orange's user avatar
0 votes

Relevance of dependency Injection

The other case is usually testing, where instead of injecting the real database or similar, you inject a mock object.
pjc50's user avatar
  • 10.8k

Top 50 recent answers are included