Roots
designate the components to choose as "garbage collection roots" for the object graph.
The purpose of the Roots
/garbage collection
mechanism is to allow you to pass to the injector more bindings
than strictly necessary and defer the choice of what specific components to construct from those bindings.
Effectively, this selects a sub-graph of the largest possible object graph that can be described by bindings.
Tests in distage-testkit
and roles in distage-framework
are built on this mechanism.
distage-testkit
's test cases designate their parameters as roots and instantiate only the sub-graph
required for a given test case. distage-framework
's roles are effectively just allow you to choose root components
and pass them command-line parameters.
Attributes
- See also:
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- object Everything.typeclass Of