endovena ~master
Simple D Dependency Injection Framework
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:
endovena
Simple dependency injection framework for D.
Based on Jakub Stasiak similar work.
Example usage
import std.conv : to;
import std.stdio : writefln;
import endovena;
interface IGreeter {
string greet();
}
class Greeter: IGreeter {
string greet() { return "Hello!"; }
}
void main() {
Container container;
container.register!(IGreeter, Greeter);
auto greeter = container.get!IGreeter();
writefln(greeter.greet)
}
Output:
Hello!
See also directory tests/
and wiki.
Compiling
You can use dub:
$ dub build
Or (on linux) makefile:
$ make
Running tests
You need to have dub >= 0.9.21 installed and reacheble from your PATH.
dub --verbose test
or with make:
$ make
Related Projects
References
- dryioc C# IoC
- unit-threaded Multi-threaded unit test framework for D.
License
Distributed under the Boost Software License, Version 1.0. See copy at http://www.boost.org/LICENSE10.txt.
- ~master released 7 years ago
- o3o/endovena
- Boost
- Copyright © 2014, Orfeo Da Viá
- Authors:
- Dependencies:
- none
- Versions:
-
0.3.4 2017-Mar-29 0.3.3 2016-Aug-04 0.3.1 2015-Sep-25 0.3.0 2014-Nov-27 0.2.0 2014-Oct-22 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
428 downloads total
-
- Score:
- 1.8
- Short URL:
- endovena.dub.pm