New answers tagged dependency-injection
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 ...
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 ...
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. ...
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.
Top 50 recent answers are included
Related Tags
dependency-injection × 647c# × 152
design-patterns × 120
inversion-of-control × 77
object-oriented × 55
design × 54
unit-testing × 52
java × 47
php × 41
architecture × 40
object-oriented-design × 37
ioc-containers × 34
.net × 31
service-locator × 26
interfaces × 24
spring × 23
dependency-inversion × 22
domain-driven-design × 21
c++ × 20
asp.net-core × 18
solid × 17
dependencies × 17
tdd × 15
dependency-management × 15
asp.net-mvc × 14