The building blocks of Winter are the components
and the graphs
.
Components store the dependency provider; basically the dependency definitions provided to Winter - they are
the blueprints for the graph
.
Graphs are used to retrieve and instantiate dependencies defined in components
.
Think of Graphs as instances of components
.
interface BoundService<R : Any>
Interface for bound service entries in a Graph. |
|
class ClassTypeKey<R : Any> : TypeKey<R> |
|
class Component
The Component stores the dependency providers which are than retrieved and instantiated by an instance of a graph. |
|
abstract class GenericClassTypeKey<R : Any> : TypeKey<R> |
|
class Graph
The object graph class that retrieves and instantiates dependencies registered in its component. |
|
data class Scope |
|
interface TypeKey<out R : Any>
Interface for all type keys. |
|
interface UnboundService<R : Any>
Interface for service entries registered in a Component. |
|
object Winter : WinterApplication
The default WinterApplication object. |
|
open class WinterApplication
Holds plugins, the application Component, the application Graph and offers an abstraction to inject dependencies into classes that cannot make use of constructor injection using an InjectionAdapter system. |
class CyclicDependencyException : WinterException
Exception that is thrown when a cyclic dependency was detected. |
|
class DependencyResolutionException : WinterException
Exception that is thrown when an error occurs during dependency resolution. |
|
class EntryNotFoundException : WinterException
Exception that is thrown when a component entry or graph was not found but was requested as non-optional. |
|
open class WinterException : Exception
Base exception class of all exception thrown by Winter. |
typealias ComponentBuilderBlock = Component.Builder.() -> Unit
Function signature alias for component builder DSL blocks. |
|
typealias GFactory<R> = Graph.() -> R
Factory function signature with Graph as receiver. |
|
typealias GFactoryCallback<R> = Graph.(R) -> Unit
Factory callback function signature with Graph as receiver. Used for onPostConstruct and onClose callbacks. |
|
typealias Provider<R> = () -> R
Provider function signature. |
fun component(qualifier: Any = ApplicationScope::class, block: ComponentBuilderBlock): Component
Create an instance of Component. |
|
fun emptyComponent(): Component
Returns a Component without qualifier and without any declared dependencies. |
|
fun emptyGraph(): Graph
Returns a Graph with empty component. |
|
fun graph(qualifier: Any = ApplicationScope::class, block: ComponentBuilderBlock): Graph
Create an ad-hoc instance of Graph. |
|
fun <R : Any> typeKey(qualifier: Any? = null, generics: Boolean = false): TypeKey<R>
|