# IoC (Disambiguation)

IoC is a term with multiple meanings, including Inversion of Control in design patterns and Indicator of Compromise in cybersecurity.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Spring internals - BeanPostProcessor

DevFeed: [Spring internals - BeanPostProcessor](<https://devfeed.tech/articles/spring-internals-beanpostprocessor-27299.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201902/beanpostprocessor/>)

Published: 2019-02-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Spring Framework](<https://devfeed.tech/topics/spring-framework.md>), [Spring Boot](<https://devfeed.tech/topics/spring-boot.md>), [Code](<https://devfeed.tech/topics/code.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [IoC (Disambiguation)](<https://devfeed.tech/topics/ioc.md>)

Tags: [boot-process](<https://devfeed.tech/tags/boot-process.md>), [code](<https://devfeed.tech/tags/code.md>), [container](<https://devfeed.tech/tags/container.md>), [context](<https://devfeed.tech/tags/context.md>), [customization](<https://devfeed.tech/tags/customization.md>), [execution](<https://devfeed.tech/tags/execution.md>), [framework](<https://devfeed.tech/tags/framework.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [spring](<https://devfeed.tech/tags/spring.md>), [spring-boot](<https://devfeed.tech/tags/spring-boot.md>), [spring-framework](<https://devfeed.tech/tags/spring-framework.md>)

### AI overview

This article explains Spring's BeanPostProcessor interface and its role during Spring container initialization. It describes how post-processors customize bean instances before and after initialization, can interrupt further processing, and can support examples such as measuring selected method execution times.

### Source excerpt

Have you ever wondered how spring does things? How field annotated with @Autowired is populated? How asynchronous or scheduled methods are discovered. In this post, I'm going to take a deeper look and scratch a bit on the surface of spring internals. I'll focus on BeanPostProcessor interface which can be used to achieve interesting things and is used in many various functionalities across spring framework itself. Read more

## Automocking and the Dependency Inversion Principle

DevFeed: [Automocking and the Dependency Inversion Principle](<https://devfeed.tech/articles/automocking-and-the-dependency-inversion-principle-20775.md>)

Original publisher: [Read original article](<https://conductofcode.io/post/automocking-and-the-dependency-inversion-principle/>)

Author: {"twitter"=\>"hlaueriksson"}

Published: 2017-02-28T20:00:00Z

Content type: tutorial

Language: en

Sources: [Henrik Lau Eriksson](<https://devfeed.tech/sources/henrik-lau-eriksson.md>)

Topics: [Dependency Inversion](<https://devfeed.tech/topics/dependency-inversion.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [IoC (Disambiguation)](<https://devfeed.tech/topics/ioc.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [client](<https://devfeed.tech/topics/client.md>)

Tags: [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [dependency-inversion](<https://devfeed.tech/tags/dependency-inversion.md>), [framework](<https://devfeed.tech/tags/framework.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [testing](<https://devfeed.tech/tags/testing.md>), [xunit](<https://devfeed.tech/tags/xunit.md>)

### AI overview

This tutorial explains how to adapt an automocking base class for C# code that uses internal classes. It shows how friend assemblies, public interfaces, an IoC container, and injected real or fake dependencies can support unit testing while preserving dependency inversion.

### Source excerpt

I had reason to revisit the automocked base class from a previous blog post. I am working with another code base and have new opportunities for automocking. We have a lot of internal classes. Approximately 30% of the classes are marked as internal. The old approach did not work anymore.

## How to use AutoFactories in StructureMap

DevFeed: [How to use AutoFactories in StructureMap](<https://devfeed.tech/articles/how-to-use-autofactories-in-structuremap-33398.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2012/06/12/AutoFactories-In-StructureMap>)

Published: 2012-06-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [IoC (Disambiguation)](<https://devfeed.tech/topics/ioc.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [Extension](<https://devfeed.tech/topics/extension.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [framework](<https://devfeed.tech/tags/framework.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>)

### AI overview

This tutorial explains how AutoFactories work in StructureMap. It describes them as interfaces whose implementations are generated by StructureMap, and presents their use in addressing circular dependencies in a plugin framework.

### Source excerpt

While watching the StructureMap discussion on google groups, a user wanted to do AutoFactories in StructureMap, something they were able to do in Castle.Windsor. I didn't know what they were so I had to look through the code plus documentation of the Castle.Windsor feature. It turns out that an AutoFactory is basically a specialized service locator that has no direct dependency on any kind of container. You write an interface that has methods to get instances from the container - but you let StructureMap generate the implementation of this interface. Sound funny? Let me show you...

## Automocking containers are not just for mocks

DevFeed: [Automocking containers are not just for mocks](<https://devfeed.tech/articles/automocking-containers-are-not-just-for-mocks-33366.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2011/04/13/automocking-containers-are-not-just-for>)

Published: 2011-04-13T00:00:00Z

Content type: opinion

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>), [IoC (Disambiguation)](<https://devfeed.tech/topics/ioc.md>)

Tags: [component](<https://devfeed.tech/tags/component.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [integration-test](<https://devfeed.tech/tags/integration-test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

The article argues that automocking containers can support partially mocked integration tests, not only unit tests using mocks. It describes MoqContrib's approach of favoring the last registered component, allowing tests to start with production implementations and replace selected components with mocks, or override mocks with production implementations.

### Source excerpt

In my last post I introduced MoqContrib's automocking container. In this post I want to describe what sets it apart from MoqContrib's previous automocking container and all other automocking containers that I've heard of thus far.A Castle.Windsor contributor said that for unit tests, "it's recommended that you don't use the container at all, or if the test setup gets too dense because of dependencies, use an AutoMockingContainer." This is in response to a stack overflow question regarding how to remove components in order to replace them with mocks. There are others that agree with him.I don't agree with Mauricio or Derek (from the links above). I strongly believe that there are several reasons to let an automocking container have real services registered that aren't mocks. The primary reason is for integration tests. This is where you are testing a system of modules, a subset of the entire system, but you still need to isolate those modules to just the system under test (SUT). So while the dependencies within the SUT are going to be implemented with real implementations, everything else is mocked. This is a partially mocked situation.One of the big reasons to use an automocking container is just to simplify everything. Sure, you're setups are starting to get pretty long for unit tests, but sometimes you run into issues where there is already a component registered so you can't register a mock without first removing the original component. This is very tedious and totally ruins any love you might have had for your IoC container.In MoqContrib 1.0 the container will favor the last component registered over everything else. This is handy because you can do setups by exception. For an integration test fixture you can setup everything as a production implementation and then just mock components as needed. You can also do it the other way and just override with production implementations. I believe this will lead to much cleaner tests and much less time tracking down "how

## Introducing MoqContrib Auto-mocking Container

DevFeed: [Introducing MoqContrib Auto-mocking Container](<https://devfeed.tech/articles/introducing-moqcontrib-auto-mocking-container-33365.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2011/04/06/introducing-moqcontrib-auto-mocking>)

Published: 2011-04-06T00:00:00Z

Content type: release

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [Mocking](<https://devfeed.tech/topics/mocking.md>), [IoC (Disambiguation)](<https://devfeed.tech/topics/ioc.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>)

Tags: [mocking](<https://devfeed.tech/tags/mocking.md>), [object](<https://devfeed.tech/tags/object.md>), [release](<https://devfeed.tech/tags/release.md>), [service](<https://devfeed.tech/tags/service.md>), [setup](<https://devfeed.tech/tags/setup.md>), [tests](<https://devfeed.tech/tags/tests.md>), [times](<https://devfeed.tech/tags/times.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>), [verify](<https://devfeed.tech/tags/verify.md>)

### AI overview

The article announces MoqContrib Auto-mocking Container, an inversion-of-control container for Moq Contrib intended for use with unit tests and mocking. An alpha release is planned first for Castle.Windsor, followed by Autofac support.

### Source excerpt

The past couple weeks I have been working on an auto-mocking inversion of control container for Moq Contrib. The first results are almost ready to release in the form of an Alpha. The first container to be released will be Castle.Windsor, later we will release an Autofac container.You will be interested in this project if you use an IoC container in conjunction with unit tests and mocking (with Moq). You probably find yourself writing setups like:[SetUp]public void Given(){ _service = Mock<IService>(); Container.Register(For<IService>().Instance(service.Object));}[Test]public void I_did_something() { var test = new TestThingy(); test.DoSomething(); _service.Verify(x => x.Something(), Times.Once();}When you use an auto-mocking container, the container will create mocks at resolve-time if it doesn't already have a component for it. So in the above example, the setup would drop out completely as there wouldn't be any need to explicitly create and register the mock:[Test]public void I_did_something() { var test = new TestThingy(); test.DoSomething(); _service.Verify(x => x.Something(), Times.Once();}We will release an alpha version of the Castle.Windsor auto-mocking container later this week. Soon after we will add an Autofac container and start working towards a regular release schedule. If you are interested, visit the site at codeplex and give feedback through the discussion groups.Happy Mocking!

## Incidental Inversion of Control

DevFeed: [Incidental Inversion of Control](<https://devfeed.tech/articles/incidental-inversion-of-control-33348.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2010/05/28/incidental-inversion-of-control>)

Published: 2010-05-28T00:00:00Z

Content type: opinion

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [IoC (Disambiguation)](<https://devfeed.tech/topics/ioc.md>), [Spring Framework](<https://devfeed.tech/topics/spring-framework.md>), [ASP.NET](<https://devfeed.tech/topics/aspnet.md>), [Java](<https://devfeed.tech/topics/java.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [XML](<https://devfeed.tech/topics/xml.md>)

Tags: [asp-net](<https://devfeed.tech/tags/asp-net.md>), [java](<https://devfeed.tech/tags/java.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [programming](<https://devfeed.tech/tags/programming.md>), [spring-framework](<https://devfeed.tech/tags/spring-framework.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

The article explains Inversion of Control (IoC) as a framework design approach in which frameworks handle common work and invoke application code when appropriate. It discusses examples in Java web applications and ASP.NET, then describes an eQube scheduler that uses XML configuration, event hooks, and JavaScript to automate reports with different filter configurations.

### Source excerpt

This morning I started reading about the Spring Framework and, as usual, I followed a rabbit hole to learn what the phrase Inversion of Control (IoC) means. IoC is also known as the Hollywood Effect ("don't call us, we'll call you"). A lot of programming frameworks use an inversion of control to take care of the bulk of the work and leave your code to perform its task (and only its task).Most web frameworks are a good example of IoC. In Java web applications, the framework takes care of all HTTP complexities and turns control over to your servlet or JSP when the time is right. This leaves your JSP to process the request and return a response - easy! The ASP.NET framework has an excellent inversion of control with its postback model. The framework allows for applications to be built very similar to Windows applications - the underlying framework takes care of display issues and calls parts of the applications code when the time is right. A lot of these calls to code are handlers for events like Click, Load, and others.As I read about this "new" concept I began to realize that it wasn't new at all. ASP.NET and J2EE use it extensively. In fact, I have created such a framework without realizing what I created. In the middle of last year I created a pluggable scheduler interface for our eQube environment that allows the programmer to simply specify report names and filter values via XML, and when it comes time to do something special, the programmer can hook into events and have the framework execute some JavaScript code to do something special.I stumbled into creating this framework after doing several short projects that required some boilerplate code to interface with the eQube APIs. It all happened quite innocently, but having taken the incidental route to IoC framework I have gotten much more value than I thought I would. For instance, it is suddenly very easy to run a report with 400 different filter configurations. I just put together some XML to spec the report a