Go to file
2016-02-03 23:51:19 +01:00
example Fix line delimiters 2016-01-06 20:28:25 +01:00
source/poodinis Add setting persistent resolve options 2016-02-03 23:13:36 +01:00
test/poodinis Add test to verify registerBeforeResolving fails for interfaces 2016-02-03 23:51:19 +01:00
.gitignore Ignore IntelliJ project file 2016-01-17 18:23:26 +01:00
.travis.yml Add only compatible LDC compiler to Travis build 2016-02-01 20:26:28 +01:00
CHANGES.md Add setting persistent resolve options 2016-02-03 23:13:36 +01:00
dub.json Update copyrights 2016-01-06 20:18:35 +01:00
LICENSE.txt Update copyrights 2016-01-06 20:18:35 +01:00
README.md Mention minimum compiler requirement 2016-02-01 20:18:05 +01:00
TUTORIAL.md Stick tutorial part about doNotAddConcreteTypeRegistration in the right section 2016-02-03 23:27:14 +01:00

Poodinis Dependency Injection Framework

Version 6.0.0
Copyright 2014-2016 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 (Referred to as autowiring).

Requires at least a D 2.068.0 compatible compiler
Uses the Phobos standard library
Can be built with DUB 0.9.24

History

For a full overview of changes, see CHANGES.md

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;

interface Database{};
class RelationalDatabase : Database {}

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

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

	auto writer = dependencies.resolve!DataWriter;
}

For more examples, see the examples directory.

###Tutorial For an extended tutorial walking you through all functionality offered by Poodinis, see TUTORIAL.md

Documentation

You can generate Public API documentation from the source code using DUB:

dub build --build=ddox

The documentation can then be found in docs/

Future Work

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