Component
The Component stores the dependency providers which are than retrieved and instantiated by an instance of a graph.
Instances are build by calling component with a builder block.
Components are immutable but an extended variant can be created by calling derive with a builder block.
val appComponent = component {
singleton<MyService> { MyServiceImpl(instance()) }
}
val derived = appComponent.derive {
prototype<MyOtherService> { MyOtherServiceImpl(instance(), instance()) }
}
val graph = derived.createGraph { constant<Application>(myApplicationInstance) }Content copied to clipboard
See also
Types
Functions
Link copied to clipboard
fun createGraph(application: WinterApplication = Winter, block: ComponentBuilderBlock? = null): Graph
Create a object graph from this component.
Link copied to clipboard
Create an extended copy of this component.
Link copied to clipboard
Returns a subcomponent by its qualifier.
Link copied to clipboard
Returns a subcomponent by its path.