mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Clarify tutorial text a bit
This commit is contained in:
parent
e22801017f
commit
fcf021cf74
|
@ -131,12 +131,12 @@ dependencies.register!(Color, Blue);
|
||||||
dependencies.register!(Color, Red);
|
dependencies.register!(Color, Red);
|
||||||
auto mixer = dependencies.resolve!ColorMixer;
|
auto mixer = dependencies.resolve!ColorMixer;
|
||||||
```
|
```
|
||||||
Member `mixer.colors` will now contain instances of `Blue` and `Red`. The order of the instances is not guarenteed to be that of the order in which they were registered.
|
Member `mixer.colors` will now contain instances of `Blue` and `Red`. The order in which instances are resolved is not guarenteed to be that of the order in which they were registered.
|
||||||
|
|
||||||
Application Contexts
|
Application Contexts
|
||||||
--------------------
|
--------------------
|
||||||
You can fine-tune dependency configuration using application contexts. Application contexts allow you to centralize all dependency configuration as well as define
|
You can fine-tune dependency configuration using application contexts. Application contexts allow you to centralize all dependency configuration as well as define how instances of certain classes should be constructed using factory methods.
|
||||||
how instances of certain classes should be constructed using factory methods.
|
|
||||||
###Defining and using application contexts
|
###Defining and using application contexts
|
||||||
An application context is defined as follows:
|
An application context is defined as follows:
|
||||||
```d
|
```d
|
||||||
|
@ -209,4 +209,4 @@ If you want registration options to be persistent (applicable for every call to
|
||||||
```d
|
```d
|
||||||
dependencies.setPersistentRegistrationOptions(RegistrationOption.doNotAddConcreteTypeRegistration); // Sets the option
|
dependencies.setPersistentRegistrationOptions(RegistrationOption.doNotAddConcreteTypeRegistration); // Sets the option
|
||||||
dependencies.unsetPersistentRegistrationOptions(); // Clears the persistentent options
|
dependencies.unsetPersistentRegistrationOptions(); // Clears the persistentent options
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue