All Projects → mbierlee → Poodinis

mbierlee / Poodinis

Licence: mit
A dependency injection framework for D with support for autowiring.

Programming Languages

d
599 projects
dlang
54 projects

Projects that are alternatives of or similar to Poodinis

vesselize
⛵ A JavaScript IoC container that works seamlessly with Vue.js and React.
Stars: ✭ 22 (-61.4%)
Mutual labels:  ioc, dependency-injection, injection, ioc-container
Kangaru
🦘 A dependency injection container for C++11, C++14 and later
Stars: ✭ 297 (+421.05%)
Mutual labels:  dependency-injection, ioc, injection, ioc-container
React Ioc
Hierarchical Dependency Injection with new React 16 Context API
Stars: ✭ 133 (+133.33%)
Mutual labels:  dependency-injection, ioc, injection, ioc-container
Reflex
Minimal dependency injection framework for Unity
Stars: ✭ 263 (+361.4%)
Mutual labels:  ioc, dependency-injection, injection, ioc-container
DependencyInjector
Lightweight dependency injector
Stars: ✭ 30 (-47.37%)
Mutual labels:  ioc, dependency-injection, injection, ioc-container
iocgo
A lightweight Inversion of Control (IoC) (Dependency Injection) container for Golang
Stars: ✭ 36 (-36.84%)
Mutual labels:  ioc, dependency-injection, ioc-container
Typhoon
Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
Stars: ✭ 2,711 (+4656.14%)
Mutual labels:  dependency-injection, ioc, ioc-container
SwiftInjection
Dependency Injection framework for Swift
Stars: ✭ 21 (-63.16%)
Mutual labels:  ioc, dependency-injection, ioc-container
tsdi
Dependency Injection container (IoC) for TypeScript
Stars: ✭ 50 (-12.28%)
Mutual labels:  ioc, dependency-injection, injection
Ioc
🦄 lightweight (<1kb) inversion of control javascript library for dependency injection written in typescript
Stars: ✭ 171 (+200%)
Mutual labels:  dependency-injection, ioc, ioc-container
inject
[Archived] See https://github.com/goava/di.
Stars: ✭ 49 (-14.04%)
Mutual labels:  ioc, dependency-injection, ioc-container
Typescript Ioc
A Lightweight annotation-based dependency injection container for typescript.
Stars: ✭ 427 (+649.12%)
Mutual labels:  dependency-injection, ioc, ioc-container
ashley
Ashley is a dependency injection container for JavaScript.
Stars: ✭ 23 (-59.65%)
Mutual labels:  ioc, dependency-injection, ioc-container
Zenject-2019
Dependency Injection Framework for Unity3D
Stars: ✭ 2,567 (+4403.51%)
Mutual labels:  ioc, dependency-injection, injection
ThunderboltIoc
One of the very first IoC frameworks for .Net that has no reflection. An IoC that casts its services before thunder casts its bolts.
Stars: ✭ 40 (-29.82%)
Mutual labels:  ioc, dependency-injection, ioc-container
Di
Dependency Injection and IoC framework for PHP
Stars: ✭ 5 (-91.23%)
Mutual labels:  dependency-injection, ioc, ioc-container
di
🛠 A full-featured dependency injection container for go programming language.
Stars: ✭ 156 (+173.68%)
Mutual labels:  ioc, dependency-injection, ioc-container
Container
A lightweight yet powerful IoC container for Go projects
Stars: ✭ 160 (+180.7%)
Mutual labels:  dependency-injection, ioc, ioc-container
Tsyringe
Lightweight dependency injection container for JavaScript/TypeScript
Stars: ✭ 2,761 (+4743.86%)
Mutual labels:  dependency-injection, ioc, injection
alpha-dic
Powerful dependency injection container for node.js
Stars: ✭ 27 (-52.63%)
Mutual labels:  ioc, dependency-injection, ioc-container

Poodinis Dependency Injection Framework

Version 8.0.3
Copyright 2014-2020 Mike Bierlee
Licensed under the terms of the MIT license - See LICENSE.txt

Master: Build Status - Dev: Build Status

Poodinis is a dependency injection framework for the D programming language. It is inspired by the Spring Framework and Hypodermic IoC container for C++. Poodinis supports registering and resolving classes either by concrete type or interface. Automatic injection of dependencies is supported through the use of UDAs or constructors.

Requires at least a D 2.068.2 compatible compiler
Uses the Phobos standard library
Can be built with DUB 1.1.1 or higher

Features

  • Member injection: Injection of dependencies in class members of any visibility (public, private, etc.)
  • Constructor injection: Automatic injection of dependencies in class constructors on creation.
  • Value injection: Value-types such as primitives or structs can be injected using custom value injectors.
  • Type qualifiers: Inject concrete types into members defined only by abstract types.
  • Application contexts: Control the creation of dependencies manually through factory methods.
  • Multi-threadable: Dependency containers return the same dependencies across all threads.
  • Minimal set-up: Creation and injection of conventional classes requires almost no manual dependency configuration.
  • Well-tested: Developed test-driven, a great number of scenarios are tested as part of the test suite.

See the TUTORIAL.md and examples for a complete walkthrough of all features.

Getting started

DUB Dependency

See the Poodinis DUB project page for instructions on how to include Poodinis into your project.

Quickstart

The following example shows the typical usage of Poodinis:

import poodinis;

class Driver {}

interface Database {};

class RelationalDatabase : Database {
	private Driver driver;

	this(Driver driver) { // Automatically injected on creation by container
		this.driver = driver;
	}
}

class DataWriter {
	@Autowire
	private Database database; // Automatically injected when class is resolved
}

void main() {
	auto dependencies = new shared DependencyContainer();
	dependencies.register!Driver;
	dependencies.register!DataWriter;
	dependencies.register!(Database, RelationalDatabase);

	auto writer = dependencies.resolve!DataWriter;
}

Dependency set-up can further be reduced by enabling "Register on resolve". For more details and examples, see the examples directory.

Documentation

You can find the public API documentation here.

Alternatively you can generate documentation from the source code using DUB:

dub build --build=ddox

The documentation can then be found in docs/

History

For a full overview of changes, see CHANGES.md

Value Injectors

Poodinis doesn't come with implementations of value injectors. Value injectors are available in separate projects:

Have you made any or do you know of any? Please add them to this section via a pull request or open an issue.

Projects Using Poodinis

  • Eloquent: A lightweight web application written in D
  • ioc: Slow approach to Inversion of Control in D2 language

Future Work

  • Component scan (auto-registration)
  • Phobos collections autowiring
  • Named qualifiers

Contributing

Any and all pull requests are welcome! If you (only) want discuss changes before making them, feel free to open an Issue on github. Please develop your changes on (a branch based on) the develop branch. Continuous integration is preferred so feature branches are not neccessary.

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].