Go to file
2015-07-27 21:40:14 +02:00
example Add example project demonstrating @AssignNewInstance 2015-07-06 22:55:41 +02:00
source/poodinis Add ability to assign new instance to autowired member regardless of registration scope 2015-07-06 22:55:40 +02:00
test/poodinis Add ability to assign new instance to autowired member regardless of registration scope 2015-07-06 22:55:40 +02:00
.gitignore Add example project demonstrating @AssignNewInstance 2015-07-06 22:55:41 +02:00
.project Add registration of concrete classes 2014-05-06 01:32:22 +02:00
.travis.yml Try running containerized 2015-07-27 21:40:14 +02:00
CHANGES.md Add feature branch changelog to next version 2015-07-06 22:56:49 +02:00
dub.json Add example project demonstrating @AssignNewInstance 2015-07-06 22:55:41 +02:00
LICENSE.txt Update copyrights 2015-01-25 21:55:02 +01:00
README.md Update feature branch badge 2015-07-27 21:10:42 +02:00
TUTORIAL.md Fix typo in tutorial 2015-07-04 15:18:37 +02:00

Poodinis Dependency Injection Framework

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

Master: Build Status - Dev: Build Status - Feature: 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).

Developed for D 2.068.0
Uses the Phobos standard library.
Can be built with DUB 0.9.23.

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)
  • Custom instance factories (replaces registration scopes)
  • Phobos Collection autocompletion