Skip to content

o3o/endovena

Repository files navigation

endovena

Dub version Build Status Dub download Status

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

License

Distributed under the Boost Software License, Version 1.0. See copy at http://www.boost.org/LICENSE_1_0.txt.