Git Product home page Git Product logo

jaioc's Introduction

JaIoC

Build status

Quite powerfull and flexible IoC / DI Container for C#

Code is distributed under MS-PL License.

Author is Sergey Gerasimov.

This IoC container is inspired by ideas of Funq. I tried to generalize it somewhere, add some extension points to it.

Both constructor and property dependency injection ways are supported.

jaioc's People

Contributors

gerich-home avatar

Watchers

 avatar  avatar

jaioc's Issues

Follow SRP for cycle detection

Now resolution cycle detection is turned on always.
This logic is mixed with normal ioc resolution.
It's worth to separate these responsibilities.

This should be done something like:

var builder = new IoCBuilder();

builder.Register<T1>();
...
builder.Register<Tn>();

builder.Finish();

var ioc = new CycleDetection(builder.Result);

ioc.Resolve<SomeType>();

Or like:

var builder = new CycleDetectionBuilder(new IoCBuilder());

builder.Register<T1>();
...
builder.Register<Tn>();

builder.Finish();

var ioc = builder.Result;

ioc.Resolve<SomeType>();

Make RegisterType more explicit

Now if some type A has 2 constructors the most long one is selected as a candidate for resolution.
If it fails (some of parameters can't be resolved) then next one is used and so on.

This leads to unpredictable changes in behavior when missing parameters are registered.
We should use RegisterType if it has only 1 public constructor.

It also can gain speed of RegisterType as most of code can bemoved to Register time

Usage detection

It can be usefull to check if some factory was used during resolution step.
This can help you to check if some factories are redundant or wrong one was used.
This feature can be implemented in the same way as cycle detection

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.