Top "Constructor-injection" questions

Constructor Injection is the Dependency Injection technique of passing an object's dependencies to its constructor.

How to call constructor with interface arguments when mocking a concrete class with Moq

I have the following class, which uses constructor injection: public class Service : IService { public Service(IRepository repository, IProvider provider) { ... } } For …

class mocking moq constructor-injection concreteclass
What is the use of ref in constructor-arg in java spring beans?

I'm new to spring beans, so I don't get the use of ref in constructor-arg. Why not use value again …

java spring spring-mvc constructor-injection
Registering a type with multiple constructors and string dependency in Simple Injector

I'm trying to figure out how to use Simple Injector, I've used it around the project with no problems registering …

c# dependency-injection inversion-of-control simple-injector constructor-injection
GlassFish, CDI and constructor injection

Is constructor injection supported in GlassFish 3.1's implementation of CDI for managed beans? I have a @Singleton EJB into which …

dependency-injection glassfish java-ee-6 cdi constructor-injection
Best practices for dependency injection via constructor

Inversion of control is a value-proof technique which is used to modularize a system and decouple the components from each …

c++ dependency-injection inversion-of-control constructor-injection
Best practice for @Value fields, Lombok, and Constructor Injection?

I'm developing a Java Spring application. I have some fields in my application which are configured using a .yml config …

java spring lombok constructor-injection
Constructor Injection with TinyIoC

I have just changed from Ninject to TinyIoC for dependency injection and I'm having trouble with constructor injection. I have …

c# dependency-injection constructor-injection tinyioc
Multiple Constructors with Different Parameters Springs

public class DisplayMessage { String Message; private String Message1; private String Message2; public DisplayMessage(String Message, String Message1) { this.Message=Message; …

spring constructor javabeans constructor-injection
How to configure Unity to inject an array for IEnumerable

I have a class which takes an IEnumerable constructor parameter which I want to resolve with Unity and inject an …

dependency-injection inversion-of-control unity-container constructor-injection