mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Adjust tutorial a bit
This commit is contained in:
parent
472cfc432f
commit
78e8acd7a3
|
@ -186,12 +186,12 @@ application context, but don't neccesarily have to be. You can even autowire dep
|
||||||
Application contexts are directly autowired after they have been registered. This means that all autowired dependencies which are not registered in the application context itself need to be registered before registering the application context.
|
Application contexts are directly autowired after they have been registered. This means that all autowired dependencies which are not registered in the application context itself need to be registered before registering the application context.
|
||||||
|
|
||||||
###Controlling component registration
|
###Controlling component registration
|
||||||
You can further influence how instances are registered and created with additional UDAs:
|
You can further influence how components are registered and created with additional UDAs:
|
||||||
```d
|
```d
|
||||||
class Context : ApplicationContext {
|
class Context : ApplicationContext {
|
||||||
@Component
|
@Component
|
||||||
@Prototype // Will create a new instance every time the dependency is resolved.
|
@Prototype // Will create a new instance every time the dependency is resolved.
|
||||||
@RegisterByType!SomeInterface // Registers the dependency by the specified super type so it can be resolved when a dependency of that super type is required.
|
@RegisterByType!SomeInterface // Registers the dependency by the specified super type instead of the return type
|
||||||
public SomeClass someClass() {
|
public SomeClass someClass() {
|
||||||
return new SomeClass();
|
return new SomeClass();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue