dejector 0.0.1
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 an attempt to create a 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);
Greeter greeter = dejector.get!Greeter;
writefln(greeter.greet)
}
Output::
Hello!
Running tests
You need to have dub <https://github.com/rejectedsoftware/dub>
_ installed and reacheble from your PATH.
::
./runtests
Copyright
Copyright (C) 2013 Jakub Stasiak
This source code is licensed under MIT license, see LICENSE file for details.
- Registered by Jakub Stasiak
- 0.0.1 released 11 years ago
- jstasiak/dejector
- github.com/jstasiak/dejector
- MIT
- Copyright © 2013, Jakub Stasiak
- Authors:
- Dependencies:
- dunit
- Versions:
-
0.0.1 2013-Nov-10 ~master 2014-Mar-27 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
224 downloads total
-
- Score:
- 1.4
- Short URL:
- dejector.dub.pm