factoryMethodBasedFactory

Invoke T's method to create data of type X.

Configures aggregate's factory to call method of factoryMethod with args, in order to create data of type X. In case when method is not a static member, the function requires to pass a instance of factoryMethod or a reference to it. The algorithm will check for args compatiblity with parameters of factory method. No type check is done for arguments that are references at compile time.

  1. auto factoryMethodBasedFactory(Locator!() locator, W factoryMethod, Args args)
  2. auto factoryMethodBasedFactory(Locator!() locator, Args args)
    factoryMethodBasedFactory
    (
    T
    string method
    Args...
    )
    (,
    auto ref Args args
    )
    if (
    isStaticMethodCompatible!(T, method, Args)
    )

Parameters

args Args

a list of arguments passed to factory method

T

type of factoryMethod

method

the method that is called from T to instantiate aggregate

Meta