DependencyContainer

The dependency container maintains all dependencies registered with it.

Dependencies registered by a container can be resolved as long as they are still registered with the container. Upon resolving a dependency, an instance is fetched according to a specific scope which dictates how instances of dependencies are created. Resolved dependencies will be autowired before being returned.

In most cases you want to use a global singleton dependency container provided by getInstance() to manage all dependencies. You can still create new instances of this class for exceptional situations.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

clearAllRegistrations
void clearAllRegistrations()

Clears all dependency registrations managed by this container.

isRegistered
bool isRegistered()
Undocumented in source. Be warned that the author may not have intended to support it.
register
Registration register(RegistrationOption options)

Register a dependency by concrete class type.

register
Registration register(RegistrationOption options)

Register a dependency by super type.

removeRegistration
void removeRegistration()

Removes a registered dependency by type.

resolve
RegistrationType resolve(ResolveOption resolveOptions)

Resolve dependencies.

resolve
QualifierType resolve(ResolveOption resolveOptions)

Resolve dependencies using a qualifier.

resolveAll
RegistrationType[] resolveAll(ResolveOption resolveOptions)

Resolve all dependencies registered to a super type.

setPersistentRegistrationOptions
void setPersistentRegistrationOptions(RegistrationOption options)

Apply persistent registration options which will be used everytime register() is called.

setPersistentResolveOptions
void setPersistentResolveOptions(ResolveOption options)

Apply persistent resolve options which will be used everytime resolve() is called.

unsetPersistentRegistrationOptions
void unsetPersistentRegistrationOptions()

Unsets all applied persistent registration options

unsetPersistentResolveOptions
void unsetPersistentResolveOptions()

Unsets all applied persistent resolve options

Meta