glue-dejector 0.3.1
Proof of concept 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:
dejector
.. image:: https://travis-ci.org/jstasiak/dejector.png?branch=master :alt: Build status :target: https://travis-ci.org/jstasiak/dejector
This is a proof of concept of dependency injection framework for D and my way of learning the language.
Example usage
.. code-block:: d
import std.conv : to;
import std.stdio : writefln;
import dejector : Dejector;
interface Greeter {
string greet();
}
class GreeterImplementation : Greeter {
string greet() { return "Hello!"; }
}
void main() {
Dejector dejector;
dejector.bind!(Greeter, GreeterImplementation);
auto greeter = dejector.get!Greeter;
writefln(greeter.greet)
}
Output::
Hello!
Running tests
You need to have dub <https://github.com/rejectedsoftware/dub>
_ >= 0.9.21 installed and reacheble from your PATH.
::
dub --verbose test
Copyright
Copyright (C) 2013 Jakub Stasiak
This source code is licensed under MIT license, see LICENSE file for details.
- 0.3.1 released 4 years ago
- filipmalczak/dejector
- github.com/FilipMalczak/dejector
- MIT
- Copyright © 2013, Jakub Stasiak
- Authors:
- Dependencies:
- optional, dunit
- Versions:
-
0.3.1 2020-Apr-16 0.3.0 2020-Apr-15 0.2.0 2020-Apr-08 ~master 2020-Jun-29 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
1155 downloads total
-
- Score:
- 0.3
- Short URL:
- glue-dejector.dub.pm