Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Features

Nikolay Pianikov edited this page Jun 22, 2017 · 51 revisions
  • Simple - supports fluent API.

  • Fast - much faster than most other IoC containers.

  • Supports constructor/property/method injection.

  • Easiest way for TDD - it is easy to wrire unit tests.

  • Provides an ability to use states during resolving. For example.

  • Supports configuring of IoC containers via:

    Fluent API

    Aspect-oriented (attributes)

    Compiled-on-demand CSharp

    Json. For this case it is not necessary to have any additional references to IoC libraries, thus nearly any code could work according to IoC pattern without any additional changes. For example, this sample project does not know about IoC at all. It is easy to create your own formats.

  • Supports DI specified by:

    contract - on or more types

    state - ordered type(s) of states

    tag - represented by the tag value(s)

  • Supports hierarchy of containers.

  • Each registration could be removed, so each container could be reused.

  • Fully extensible by own implementations of interfaces in the contracts assembly, also supports custom IoC containers, implementing the interface IContainer.

  • There is a set of pluggable features:

    Child containers - supports the resolving of child containers. It is possible to use your own implementation of IContainer.

    Lifetimes - supports lifetimes (Singleton, AutoDisposing, PerContainer, PerResolve, PerThread, PerState). It is easy to extend by implementing ILifetime.

    Scopes - supports scopes (Internal, Global). It is easy to extend by implementing IScope.

    Key comparers - supports key comparers (AnyTag, AnyState, AnyTagAnyState). It is easy to extend by implementing IKeyComparer.

    Enumerables - supports a resolving via IEnumerable<>. Resolve all elements of specified contract.

    Observables - supports a resolving via IObservable<>. Resolve all elements of specified contract.

    Tasks - supports an injection via Task<>.

    Resolvers - supports a resolving via IResolver<...>, IProvider<...>, Func<...>, Lazy.

    And others. For example the feature Tasks allows an injection of tasks.

        public EventRegistry(
             Task<IResolver> resolver,
             Task<IEventBroker> eventBroker,
             [State(0, typeof(string))] Task<IResolver<string, ILog>> logResolver)
        {
            logResolver.Start();
            resolver.Start();
            eventBroker.Start();
            Task.WaitAll(resolver, eventBroker, logResolver);
            ...
        }
Clone this wiki locally