mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Add note on contributing to README
This commit is contained in:
parent
7e058170dc
commit
8c83eecaa7
143
README.md
143
README.md
|
@ -1,69 +1,74 @@
|
||||||
Poodinis Dependency Injection Framework
|
Poodinis Dependency Injection Framework
|
||||||
=======================================
|
=======================================
|
||||||
Version 6.0.0
|
Version 6.0.0
|
||||||
Copyright 2014-2016 Mike Bierlee
|
Copyright 2014-2016 Mike Bierlee
|
||||||
Licensed under the terms of the MIT license - See [LICENSE.txt](LICENSE.txt)
|
Licensed under the terms of the MIT license - See [LICENSE.txt](LICENSE.txt)
|
||||||
|
|
||||||
Master: [![Build Status](https://api.travis-ci.org/mbierlee/poodinis.png?branch=master)](https://travis-ci.org/mbierlee/poodinis) - Dev: [![Build Status](https://api.travis-ci.org/mbierlee/poodinis.png?branch=develop)](https://travis-ci.org/mbierlee/poodinis)
|
Master: [![Build Status](https://api.travis-ci.org/mbierlee/poodinis.png?branch=master)](https://travis-ci.org/mbierlee/poodinis) - Dev: [![Build Status](https://api.travis-ci.org/mbierlee/poodinis.png?branch=develop)](https://travis-ci.org/mbierlee/poodinis)
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
Requires at least a D 2.068.0 compatible compiler
|
Requires at least a D 2.068.0 compatible compiler
|
||||||
Uses the Phobos standard library
|
Uses the Phobos standard library
|
||||||
Can be built with DUB 0.9.24
|
Can be built with DUB 0.9.24
|
||||||
|
|
||||||
History
|
History
|
||||||
-------
|
-------
|
||||||
For a full overview of changes, see [CHANGES.md](CHANGES.md)
|
For a full overview of changes, see [CHANGES.md](CHANGES.md)
|
||||||
|
|
||||||
Getting started
|
Getting started
|
||||||
---------------
|
---------------
|
||||||
###DUB Dependency
|
###DUB Dependency
|
||||||
See the Poodinis [DUB project page] for instructions on how to include Poodinis into your project.
|
See the Poodinis [DUB project page] for instructions on how to include Poodinis into your project.
|
||||||
|
|
||||||
###Quickstart
|
###Quickstart
|
||||||
The following example shows the typical usage of Poodinis:
|
The following example shows the typical usage of Poodinis:
|
||||||
```d
|
```d
|
||||||
import poodinis;
|
import poodinis;
|
||||||
|
|
||||||
interface Database{};
|
interface Database{};
|
||||||
class RelationalDatabase : Database {}
|
class RelationalDatabase : Database {}
|
||||||
|
|
||||||
class DataWriter {
|
class DataWriter {
|
||||||
@Autowire
|
@Autowire
|
||||||
private Database database; // Automatically injected when class is resolved
|
private Database database; // Automatically injected when class is resolved
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
auto dependencies = DependencyContainer.getInstance();
|
auto dependencies = DependencyContainer.getInstance();
|
||||||
dependencies.register!DataWriter;
|
dependencies.register!DataWriter;
|
||||||
dependencies.register!(Database, RelationalDatabase);
|
dependencies.register!(Database, RelationalDatabase);
|
||||||
|
|
||||||
auto writer = dependencies.resolve!DataWriter;
|
auto writer = dependencies.resolve!DataWriter;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
For more examples, see the [examples](example) directory.
|
For more examples, see the [examples](example) directory.
|
||||||
|
|
||||||
###Tutorial
|
###Tutorial
|
||||||
For an extended tutorial walking you through all functionality offered by Poodinis, see [TUTORIAL.md](TUTORIAL.md)
|
For an extended tutorial walking you through all functionality offered by Poodinis, see [TUTORIAL.md](TUTORIAL.md)
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
You can generate Public API documentation from the source code using DUB:
|
You can generate Public API documentation from the source code using DUB:
|
||||||
```
|
```
|
||||||
dub build --build=ddox
|
dub build --build=ddox
|
||||||
```
|
```
|
||||||
The documentation can then be found in docs/
|
The documentation can then be found in docs/
|
||||||
|
|
||||||
Future Work
|
Future Work
|
||||||
-----------
|
-----------
|
||||||
* Component scan (auto-registration)
|
* Component scan (auto-registration)
|
||||||
* Phobos collections autowiring
|
* Phobos collections autowiring
|
||||||
* Constructor injection
|
* Constructor injection
|
||||||
* Named qualifiers
|
* Named qualifiers
|
||||||
|
|
||||||
[Spring Framework]: http://projects.spring.io/spring-framework/
|
Contributing
|
||||||
[Hypodermic]: https://github.com/ybainier/hypodermic/
|
------------
|
||||||
[DUB]: http://code.dlang.org/
|
Any and all pull requests are welcome! If you (only) want discuss changes before making them, feel free to open an Issue on github.
|
||||||
[DUB project page]: http://code.dlang.org/packages/poodinis
|
Please develop your changes on (a branch based on) the develop branch. Continuous integration is preferred so feature branches are not neccessary.
|
||||||
[Github issue tracker]: https://github.com/mbierlee/poodinis/issues
|
|
||||||
|
[Spring Framework]: http://projects.spring.io/spring-framework/
|
||||||
|
[Hypodermic]: https://github.com/ybainier/hypodermic/
|
||||||
|
[DUB]: http://code.dlang.org/
|
||||||
|
[DUB project page]: http://code.dlang.org/packages/poodinis
|
||||||
|
[Github issue tracker]: https://github.com/mbierlee/poodinis/issues
|
||||||
|
|
Loading…
Reference in a new issue