What makes an IoC container an IoC container?
NickName:Moon Ask DateTime:2014-03-22T09:27:02

What makes an IoC container an IoC container?

So..I've been digging into IoC container and service locator.

I thought an IoC container is an IoC container, not a service locator because

  1. The way you use it. You pass a service locator to a class that needs dependencies and then retrieve a dependencies via the container. On the other hand, you inject dependencies to your class using IoC container.

  2. IoC containers support auto-wiring, whereas service locators don't.

I always thought that IoC containers support auto-wiring and it has to support it to be called an IoC container, but I had a conversion with some people who told me that IoC container doesn't have to support auto-wring.

If that's true, what makes an IoC container an IoC container except the way you use it?

Copyright Notice:Content Author:「Moon」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22572261/what-makes-an-ioc-container-an-ioc-container

More about “What makes an IoC container an IoC container?” related questions

What makes an IoC container an IoC container?

So..I've been digging into IoC container and service locator. I thought an IoC container is an IoC container, not a service locator because The way you use it. You pass a service locator to a class

Show Detail

What are the pros and cons for using a IOC container?

Using a IOC container will decrease the speed of your application because most of them uses reflection under the hood. They also can make your code more difficult to understand(?). On the bright si...

Show Detail

IoC container concept in PHP

I'm trying to grasp the concept of IoC and Dependency Injection in PHP, So iv'e decided to go on and create a small framework and implement these design patterns. i've created my own IoC class whi...

Show Detail

IoC Container Applicability / Scenario Demonstration?

A lot of people in the .NET space have picked up Castle Windsor and are implementing it in their projects, and for the past year I've been struggling to figure out why IoC containers seem to be tre...

Show Detail

IOC container in Spring MVC

What IOC container is used in Spring MVC and can we use more than 1 container and how ? I know that we can use multiple IOC container using spring. But can we use same in Spring MVC.

Show Detail

What is the difference between BeanFactory container, ApplicationContext container and IOC container?

I am new to Spring, I read BeanFactory is also called basic IOC and ApplicationContext is called Advanced IOC. I read: BeanFactory Container is the simplest container providing the basic support fo...

Show Detail

Best Practices for IOC Container

I'm using the Unity IOC container and I'm just wondering what is the best best way to access the container for multiple classes. Should every class have an IUnityContainer member and then pass the

Show Detail

IOC Container Runtime Resolution

I'm trying to find an IOC container that will allow me to have mapping data for a field stored in a database and resolve the interface or object that needs resolved via a string value pulled from the

Show Detail

Proper way to pass IoC container

I am getting my head around DI and IoC; using Pimple for now. Lets say I have my IoC defined early in the execution flow $container = new Injection\Container(); $container['config'] = function ($...

Show Detail

Mocking an IoC Container?

Does it make sense to mock an IoC container? If so how would I go about it, using Moq? I am creating a Prism 4 app, using Unity 2.0 as the IoC container. I inject the container into classes that n...

Show Detail