FactoryMethodBasedFactory

Instantiates an aggregate using a method from other aggregate (factory method pattern).

Encapsulates construction of aggregate using factory method. Arguments that are references, will be replaced with data 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 reference is passed.

class FactoryMethodBasedFactory : ParameterHolder!Args, InstanceFactory!(ReturnType!(getCompatibleOverload!(T, method, Args)))(
T
string method
W
Args...
) if (
(
is(W : T)
)
&&
isMethodCompatible!(T, method, Args)
&&
isAggregateType!(ReturnType!(getCompatibleOverload!(T, method, Args)))
) {}

Constructors

this
this(W fact, Args args)
Undocumented in source.
this
this(Args args)
Undocumented in source.

Members

Functions

factory
Z factory()

See InstanceFactory interface

Parameters

T

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

method

the name of method used to instantiate aggregate

W

the factory T, or a LocatorReference to the factory.

Args

type tuple of arguments passed to factory.

Meta