PrototypeContainer

Prototype container.

Instantiates a new object using passed ObjectFactory implementation, on each request of it by some part of an application.

Constructors

this
this()

* Default constructor for PrototypeContainer

Members

Functions

get
Object get(string key)

* Get object created by a factory identified by key * * Params: * key = identity of factory * Returns: * Object

getFactories
InputRange!(Pair!(ObjectFactory, string)) getFactories()

Get all factories available in container.

getFactory
ObjectFactory getFactory(string identity)

Get factory for constructed component identified by identity.

has
bool has(string key)

* Check if an object factory for it exists in container. * * Params: * key = identity of factory * Returns: * bool

instantiate
PrototypeContainer instantiate()

Sets up the internal state of container.

link
PrototypeContainer link(string key, string alias_)

Alias a key to an alias_.

remove
PrototypeContainer remove(string key)

* Remove an object factory from container. * * Params: * key = identity of factory to be removed * Returns: * typeof(this)

resolve
const(string) resolve(string key)

Resolve an alias to original identity, if possible.

set
PrototypeContainer set(ObjectFactory object, string key)

* Set object factory * * Params: * object = factory for a object that is to be managed by prototype container. * key = identity of factory * Returns: * typeof(this)

terminate
PrototypeContainer terminate()

Destruct all managed components.

unlink
PrototypeContainer unlink(string alias_)

Removes alias.

Meta