inversion-of-control

What is Inversion of Control?

Inversion of Control (or IoC) can be quite confusing when it is first encountered. What is it? What problems does it solve? When is it appropriate and when not?...

Dependency Injection/Inversion of Control

I am about to dip my toe into DI/IoC for the first time with part of an app we have in production. I've spent the last month or so researching DI/IoC and will most likely use the Castle Windsor Container although NInject may be an option. Any of you folks out there got any advice & guidance on best practices, typical pinch/pain points, g...

Which .NET Dependency Injection frameworks are worth looking into?

Which C#/.NET Dependency Injection frameworks are worth looking into? And what can you say about their complexity and speed. ...

How to get the libraries you need into the bin folder when using IoC/DI

I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL layer to interfaces that are now being loaded by DI. Once the project is developed & deployed all the .bin files will be in the same location, but for while I'm developing in Visual Studio, the only ways I can see of getting the dependency inj...

IoC Explain and more important when to use it?

I am designing a new system and I want to know IoC and more important when to use it. Does it have to be implemented with interfaces or can be done with classes? Thanks ...

IoC Container Configuration/Registration

I absolutely need to use an IoC container for decoupling dependencies in an ever increasingly complex system of enterprise services. The issue I am facing is one related to configuration (a.k.a. registration). We currently have 4 different environments -- development to production and in between. These environments have numerous confi...

What is the overhead cost associated with IoC containers like StructureMap?

After attending a recent Alt.NET group on IoC I got to thinking about the tools available and how they might work. StructureMap in particular uses both attributes and bootstrapper concepts to map requests for IThing to ConcreteThing. Attributes automatically throw up flags for me that either reflection or IL injection is going on. Doe...

NInject vs. StructureMap etc...

Does anyone have any good suggestions around IoC/DI frameworks? I'm looking into them a bit, but since IoC is new to me I'm looking for pointers on what to check out first. ...

Castle Windsor: How do you add a call to a factory facility not in xml?

I know how to tell Castle Windsor to resolve a reference from a factory's method using XML, but can I do it programmatically via the Container.AddComponent() interface? If not is there any other way to do it from code? EDIT: There seems to be some confusion so let me clarify, I am looking for a way to do the following in code: <facil...

Is it bad to load many managed DLL's without using any types in them?

Background: At my company we are developing a bunch applications that are using the same core dll's. These dll's are using Spring.net's IoC-container to wire things up (auto-wiring). All applications are using the same spring configuration file, and this configuration file points to many classes in many different dll's. But not all appli...

Which single IoC/DI container would you recommend using and why?

I'm asking this question because it's a good way to gauge how the community at large feels about the various containers/frameworks and why. Also, whilst my expertise may lie in .Net development, I am very interested in which frameworks are popular (and why) in other languages. If I feel the need to start digging into Java for instance, t...

Can anyone recommend a IOC Container for C++?

I miss dependency injection more than all the raindrops in the ocean. ...

Where to put the dependency injection framework config file?

I've got a solution with several different projects in it, some are pure class libraries and some are web app projects. If I want my default types to be available to all projects, where should I put the config file for the container? ...

Windsor Container: How to force dispose of an object?

I have an object that implements IDisposable that is registered with the Windsor Container and I would like to dispose of it so it's Dispose method is called and next time Resolve is called it fetches a new instance. Does container.Release(obj); automatically call Dispose() immediately? Or do I need to do obj.Dispose(); container....

Can you register an existing instance of a type in the Windsor Container?

In the Windsor IOC container is it possible to register a type that I've already got an instance for, instead of having the container create it? ...

Windsor Container: Registering things in Code vs Xml

From what I've read about Windsor/Microkernel it is in theory possible to do everything that you can do using xml files with code. As a matter of fact - and please correct me if I'm wrong - it seems like the major contribution of the Windsor layer is to add xml configuration for things Microkernel can already do. However, I have been ...

Best IoC framework for .Net

Which is the best IoC among StructureMap and Ninject? This should be merged with: Best injections frameworks ...

Default constructor vs IOC container

Can someone explain to me the advantages of using an IOC container over simply hardcoding the default implementation into a default constructor? In other words, what is wrong about this code? public class MyClass { private IMyInterface _myInterface; public MyClass() { _myInterface = new DefaultMyInterface(); } ...

Is the Unity Framework any good for Inversion of Control?

I have been using IoC for a little while now and I am curious if I should use Microsoft's Unity framework (official name "Unity Application Block"). Does anyone have experience using it? So for I have been copying my IoC container code from project to project, but I think it would be better to using something standard. I think IoC can...

MEF (Managed Extensibility Framework) vs IoC/DI

What problems does MEF (Managed Extensibility Framework) solves that cannot be solved by existing IoC/DI containers? ...