poodinis 3.0.0
A dependency injection framework with support for autowiring.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Poodinis Dependency Injection Framework
Version 3.0.0 Copyright 2014-2015 Mike Bierlee Licensed under the terms of the MIT license - See LICENSE.txt
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
- Registered by Mike Bierlee
- 3.0.0 released 9 years ago
- mbierlee/poodinis
- lostmoment.com/open-source/poodinis
- MIT
- Copyright 2015 Mike Bierlee
- Authors:
- Dependencies:
- none
- Versions:
-
9.0.0 2023-Mar-13 8.2.0 2023-Mar-13 8.1.3 2022-Oct-26 8.1.2 2022-Feb-17 8.1.1 2021-Aug-24 - Download Stats:
-
-
4 downloads today
-
44 downloads this week
-
140 downloads this month
-
23403 downloads total
-
- Score:
- 3.5
- Short URL:
- poodinis.dub.pm