What is Dependency Injection Service Provider (DISP)?

Dependency Injection Service Provider (DISP) is a wrapper or an interface that aim to allow .NET developers use one of the inversion of control  (IoC) containers out there such as StructureMap or Ninject from a high level of abstraction, using the same interface and classes without having to worry about the concrete implementation of each of the IoC containers.

How does Dependency Injection Service Provider works?

DISP provides static class that will create and instance of an IoC container of your election, and provide an interface to allow the communication between for application and the IoC Container instance.

The final goal is to implement support for as much IoC containers as is possible and to support as many features as is possible for all of them from a high level of abstraction and using one unique API.

The class diagram bellow displays a really early architecture of DISP, as you can see DIPS provides an static class that will allow you to access all the common IoC features by just providing the type of container that you want to use and a collection of the dependencies (and options) that the container will satisfied.

DependencyInjectionServiceProvider.png

Basic usage example

DependencyInjectionServiceProvider.Initialize(
    IoCContainerTypeEnum.Ninject, //IoC contaner to be used
    new List<Service>() //List of dependencies
    {
        new Service() {
            Scope = ScopeEnum.Singleton,
            SourceType = typeof(IRepository<User>),
            TargetType = typeof(UserRepository)
        }
    }
);

Important notice

I still working on this project, there are not an stable release at the moment, you can download the code to see what is the status of the project and maybe join it but you may not use this software for any production environment as it still in an early development stage.