Dependencies

fun interface Dependencies

Where the parameters of the generated model factories come from: the domain services a command function takes besides its command. A ModelProvider resolves each when the host builds the models, once, at startup, so a missing one fails the start rather than a command. The port knows no DI framework: a host adapts its own container (Spring's bean factory, for one), and of serves tests and hosts without one.

A parameter of a parameterized type (StateViewCache<OrderStateView>) is looked up by its full type (Types), so two dependencies of one class and different type arguments are told apart; a host that knows no generics finds it by its class, the default.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun find(type: Class<*>, qualifier: String?): Any?

The dependency of type named qualifier, or the only one of type when qualifier is null; null when there is none.

open fun find(type: Type, qualifier: String?): Any?

The dependency of the full type, a parameterized one, named qualifier, or the only one of type when qualifier is null; null when there is none. By its class (Types.rawOf) by default, for a host that knows no generics; a host that does finds it by every type argument.

Link copied to clipboard
open fun <T : Any> get(type: Class<T>, qualifier: String? = null, building: String? = null): T

The dependency of type, named qualifier when it is given, to build building with (a processor, the Order model): find's, or a MissingDependencyException naming what it builds when there is none.

open fun <T : Any> get(raw: Class<T>, type: Type, qualifier: String?, building: String?, parameter: String): T

The dependency of the full type, whose class is raw, for the parameter of what it builds, building: find's by the full type, or a MissingDependencyException naming the type when there is none; an AmbiguousDependencyException naming the parameter when several are of it.