Top "Dependency-injection" questions

A design pattern to reduce coupling between components, by dynamically injecting into a software component dependencies that it needs to function.

How do you use Moq to mock a simple interface?

Okay, I have a business logic class like this: Note: For context, Vendor Briefs are simple entities that describe a "…

c# unit-testing dependency-injection mocking moq
Dependency Inject (DI) "friendly" library

I'm pondering the design of a C# library, that will have several different high level functions. Of course, those high-level …

c# dependency-injection inversion-of-control
When to use javax.inject.Provider in Spring?

What it does is pretty simple: @Inject private Provider<ProductService> productService; The Product service is available through productService.…

java spring dependency-injection provider
Spring injects dependencies in constructor without @Autowired annotation

I'm experimenting with examples from this official Spring tutorials and there is a dependency on this code: https://github.com/…

spring spring-boot dependency-injection autowired
Dependency injection and named loggers

I am interested in learning more about how people inject logging with dependency injection platforms. Although the links below and …

c# logging dependency-injection log4net nlog
ButterKnife onclick is not working

I injected views perfectly using butterknife library. But when I try to implement listeners, for example onclick I'm not able …

java android dependency-injection onclick butterknife
Guice configuration error: No implementation was bound

I'm trying to make DI with Guice work, doing (as it seems to me) exactly what's in the manual. I …

java dependency-injection guice
Dagger 2 injecting Android Application Context

I am using Dagger 2 and have it working however I now need access to the Android Application Context. Its not …

android dependency-injection android-context dagger-2
Difference between @Named and @ManagedBean annotations in JSF2.0 Tomcat7

This might be a noob question, however in a lot of tutorials and examples I saw these annotations used as …

jsf-2 dependency-injection el tomcat7