Top "Constructor-injection" questions

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

Can I pass constructor parameters to Unity's Resolve() method?

I am using Microsoft's Unity for dependency injection and I want to do something like this: IDataContext context = _unityContainer.Resolve&…

c# .net dependency-injection unity-container constructor-injection
Spring <constructor-arg> element must specify a ref or value

I'm having a problem with Spring and constructor injection. I want to create dynamically objects with a name (String) and …

java spring constructor-injection
MEF Constructor Injection

I'm trying to figure out MEF's Constructor Injection attribute. I have no idea how I tell it to load the …

c# dependency-injection mef constructor-injection
Constructor Injection in C#/Unity?

I'm using C# with Microsoft's Unity framework. I'm not quite sure how to solve this problem. It probably has something …

c# dependency-injection unity-container constructor-injection
Constructor injection using Spring annotation @Autowired does not work

I have created 2 simple classes. Constructor of one class is annotated as @Autowired. It accepts the object of another class. …

spring annotations default-constructor constructor-injection
How is the Web API Controller's constructor called?

According to this article, a Controller should have a constructor that gets the interface to be implemented passed in, a …

c# asp.net-web-api controller ioc-container constructor-injection
Implicitly injecting dependency in Base class while derived class is resolved through Unity

I have a base Class Base having dependecy Dep and default and Injection Constructor- Class Base : IBase { public IDep Dep { …

c# dependency-injection unity-container constructor-injection
EasyMock: Mock out a constructor call in java

I have a looked at similar questions on this board, but none of them answer my question. This sound strange, …

java mocking easymock constructor-injection
Spring constructor injection of SLF4J logger - how to get injection target class?

I'm trying to use Spring to inject a SLF4J logger into a class like so: @Component public class Example { …

java spring slf4j constructor-injection
Springframework constructor-arg

I have a MainClass which have 2 variables. I would like to pass those 2 values to a springframework bean class "Test". …

java spring dependency-injection constructor-injection