mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Fix minor details
This commit is contained in:
parent
880dac86f8
commit
67fa51a14f
|
@ -20,7 +20,7 @@ Features
|
||||||
* Application contexts: Control the creation of dependencies manually through factory methods.
|
* Application contexts: Control the creation of dependencies manually through factory methods.
|
||||||
* Multi-threadable: Dependency containers return the same dependencies across all threads.
|
* Multi-threadable: Dependency containers return the same dependencies across all threads.
|
||||||
* Minimal set-up: Creation and injection of conventional classes requires almost no manual dependency configuration.
|
* Minimal set-up: Creation and injection of conventional classes requires almost no manual dependency configuration.
|
||||||
* Well-tested: Developed test-driven, a great number of scenarios are tested as part of the test suite.
|
* Well-tested: Developed test-driven, a great number of scenarios are tested as part of the test suite.
|
||||||
See the [TUTORIAL.md](TUTORIAL.md) and [examples](example) for a complete walkthrough of all features.
|
See the [TUTORIAL.md](TUTORIAL.md) and [examples](example) for a complete walkthrough of all features.
|
||||||
|
|
||||||
Getting started
|
Getting started
|
||||||
|
@ -35,7 +35,7 @@ import poodinis;
|
||||||
|
|
||||||
class Driver {}
|
class Driver {}
|
||||||
|
|
||||||
interface Database{};
|
interface Database {};
|
||||||
|
|
||||||
class RelationalDatabase : Database {
|
class RelationalDatabase : Database {
|
||||||
private Driver driver;
|
private Driver driver;
|
||||||
|
@ -59,7 +59,7 @@ void main() {
|
||||||
auto writer = dependencies.resolve!DataWriter;
|
auto writer = dependencies.resolve!DataWriter;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Set-up can further be reduced by enabling "Register on resolve". For more details and examples, see the [examples](example) directory.
|
Dependency set-up can further be reduced by enabling "Register on resolve". For more details and examples, see the [examples](example) directory.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
|
@ -132,7 +132,7 @@ Classes with multiple constructors can be injected. The following rules apply to
|
||||||
* When a constructor with an empty parameter list is found, no other constructors are attempted (and nothing is injected). This can be used to explicitly prevent constructor injection.
|
* When a constructor with an empty parameter list is found, no other constructors are attempted (and nothing is injected). This can be used to explicitly prevent constructor injection.
|
||||||
* When no injectable constructor is found an InstanceCreationException will be thrown on resolve.
|
* When no injectable constructor is found an InstanceCreationException will be thrown on resolve.
|
||||||
|
|
||||||
If the constructors of a class are not suitable for injection, you could manually configure its creation using Application Contexts (see chapter further down).
|
If the constructors of a class are not suitable for injection, you could manually configure its creation using Application Contexts (see chapter further down).
|
||||||
Constructor injection has the advantage of not having to import Poodinis throughout your application.
|
Constructor injection has the advantage of not having to import Poodinis throughout your application.
|
||||||
|
|
||||||
Circular dependencies
|
Circular dependencies
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
To build any of these examples, specify the relevant DUB configuration when building with DUB:
|
To build any of these examples, specify the relevant DUB configuration when building Poodinis with DUB:
|
||||||
```
|
```
|
||||||
dub build --build=release --config=<name>Example
|
dub build --build=release --config=<name>Example
|
||||||
```
|
```
|
||||||
|
|
|
@ -9,7 +9,7 @@ import poodinis;
|
||||||
|
|
||||||
class Driver {}
|
class Driver {}
|
||||||
|
|
||||||
interface Database{};
|
interface Database {};
|
||||||
|
|
||||||
class RelationalDatabase : Database {
|
class RelationalDatabase : Database {
|
||||||
private Driver driver;
|
private Driver driver;
|
||||||
|
|
Loading…
Reference in a new issue