FactoryMethodInstanceFactory

Instantiates a component using a method from other component (factory method pattern).

Encapsulates construction of component using factory method. Arguments that are RuntimeReferences, will be replaced with components extracted from locator, and passed to factory's method. In case when method is not static member, the algorithm will use an instantiaton of factory passed to it, or extracted from locator if a RuntimeReference is passed.

  1. template FactoryMethodBasedFactory(T, string method, W, Args...)
  2. template FactoryMethodInstanceFactory(string method, T, W, Args...)
    template FactoryMethodInstanceFactory (
    string method
    T
    W
    Args...
    ) if (
    isMethodCompatible!(T, method, Args) &&
    isAggregateType!(ReturnType!(getCompatibleOverload!(T, method, Args)))
    &&
    (
    is(W : T)
    )
    ) {}
  3. auto factoryMethodBasedFactory(Args args)

Members

Aliases

Compatible
alias Compatible = getCompatibleOverload!(T, method, Args)
Undocumented in source.
Params
alias Params = Parameters!Compatible
Undocumented in source.
Z
alias Z = ReturnType!Compatible
Undocumented in source.

Classes

FactoryMethodInstanceFactory
class FactoryMethodInstanceFactory
Undocumented in source.

Parameters

T

factory that is used to instantiate component using it's method

method

the name of method used to instantiate component

W

the factory T, or a RuntimeReference to the factory.

Args

type tuple of arguments passed to factory.

Meta