Adjust tutorial a bit

This commit is contained in:
Mike Bierlee 2015-12-24 23:10:56 +01:00
parent 472cfc432f
commit 78e8acd7a3

View file

@ -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();
} }