All Projects → Keboo → AutoDI

Keboo / AutoDI

Licence: MIT license
Dependency injection made simple.

Programming Languages

C#
18002 projects
powershell
5483 projects

Projects that are alternatives of or similar to AutoDI

refuel
Lightweight dependency injection engine and DI-driven tools.
Stars: ✭ 21 (-75.86%)
Mutual labels:  dependency-injection, di-container
unbox
Fast, simple, easy-to-use DI container
Stars: ✭ 45 (-48.28%)
Mutual labels:  dependency-injection, di-container
hypo-container
A dependency injection container.
Stars: ✭ 16 (-81.61%)
Mutual labels:  dependency-injection, di-container
Mimick.Fody
An integrated framework for dependency injection and aspect-oriented processing.
Stars: ✭ 15 (-82.76%)
Mutual labels:  dependency-injection, fody
simple-container
Yet another DI container
Stars: ✭ 12 (-86.21%)
Mutual labels:  dependency-injection, di-container
Swinject
Dependency injection framework for Swift with iOS/macOS/Linux
Stars: ✭ 4,958 (+5598.85%)
Mutual labels:  dependency-injection, di-container
UniDi
Dependency Injection for Unity
Stars: ✭ 68 (-21.84%)
Mutual labels:  dependency-injection, di-container
Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (-74.71%)
Mutual labels:  dependency-injection
android-template
Template for android development at Tiki
Stars: ✭ 17 (-80.46%)
Mutual labels:  dependency-injection
extensions-dependency-injection
Microsoft Extensions DependencyInjection for WCF, and asp.net classic projects
Stars: ✭ 18 (-79.31%)
Mutual labels:  dependency-injection
lamp-luwak
Service-oriented state management for React
Stars: ✭ 12 (-86.21%)
Mutual labels:  dependency-injection
Cauldron
C# Toolkit
Stars: ✭ 68 (-21.84%)
Mutual labels:  fody
dodrugs
A macro-powered dependency injector for Haxe
Stars: ✭ 29 (-66.67%)
Mutual labels:  dependency-injection
resty
A Node.js framework
Stars: ✭ 20 (-77.01%)
Mutual labels:  dependency-injection
di
一个简易版本的Go依赖注入实现
Stars: ✭ 133 (+52.87%)
Mutual labels:  dependency-injection
okito
Your best flutter coding friend. All in one; state management, navigation management(with dynamic routing), local storage, localization, dependency injection, cool extensions with best usages and with the support of best utilities!
Stars: ✭ 37 (-57.47%)
Mutual labels:  dependency-injection
toolkit
some useful library of the php
Stars: ✭ 15 (-82.76%)
Mutual labels:  dependency-injection
definject
Unobtrusive Dependency Injector for Elixir
Stars: ✭ 46 (-47.13%)
Mutual labels:  dependency-injection
Kriptofolio
Free open source minimalistic cryptocurrencies portfolio app for Android.
Stars: ✭ 79 (-9.2%)
Mutual labels:  dependency-injection
ufw
A minimalist framework for rapid server side applications prototyping in C++ with dependency injection support.
Stars: ✭ 19 (-78.16%)
Mutual labels:  dependency-injection

AutoDI

Have a question? Join the chat at https://gitter.im/AutoDIContainer/Lobby

NuGet Status NuGet Status NuGet Status

Build Status

AutoDI is both a dependency injection container and a framework to simplify working with dependency injection (DI). It is built on top of the Microsoft.Extensions.DependencyInjection.Abstractions library, and it works very similar to the way ASP.NET Core handles dependency injection.

AutoDI delivers delivers two excellent features:

  1. It is built on Microsoft.Extensions.DependencyInjection.Abstractions library to bring the same flavor of dependency injection enjoyed on ASP.NET Core to other platforms (.NET Framework, WPF, Xamarin, UWP, etc).
  2. It generates container registrations at compile time using conventions (of course you can also add more at run-time as well).

See the wiki for more details or check out the Quick Start page to get up and running fast.

Why do I need this?

The goal of this library is to make dependency injection as simple as adding a NuGet package.

In addition to standard constructor dependency injection, it also allows optional constructor parameters that will be resolved when the constructor is invoked.

In a typical DI setup, you can often find objects needing to take in dependencies that the object itself is not using, but needs them to pass into some other object. The bigger and deeper the object model gets, the worse this becomes. As a specific example, imagine you are inside of class Foo and wish to create an instance of Bar, but Bar has a dependency on IService. In many cases, one of several options can be used:

  • Pass a facade to either the DI container or a factory that can create a Bar
  • Add a dependency on Foo to take in an IService so that when it needs to create a Bar it can simply pass the instance to Bar's constructor.

Though both these options work, they add additional effort. After all, in many cases, when we want a Bar we simply call new Bar();. AutoDI lets you write exactly that, and moves the dependency resolution inside of Bar's constructor. This dependency resolution is then forwarded to the DI container to resolve it.

Does it work with <my favorite DI container / framework>?

Probably. Take a look at the AutoDI.Examples repository for samples. There are examples of adding support for other DI containers as well as simple examples for most frameworks.

Don't see your favorite listed? I accept PRs.

Icon

Needle designed by Austin Andrews from Material Design Icons

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].