Namespace IdleKit.IoC
Classes
Binding
An implementation of IBinding
BindingException
An exception that is fired when IBinding conflicts are detected while they are being bound or resolved.
CachedProvider
Provides an instance using the IProvider. Unlike the other IProvider, the CachedProvider keeps track of the wasCached so it does not get injected when GetInstance() is called again.
Container
An implementation of the IResolver, IBinder, and IContainer
Context
A base implementation of the IContext. Override this class to provide your own container and installer.
Injector
An implementation of IInjector
Installer
A base implementation of the interface IInstaller. Override this class to create your own implementation of the IInstaller.
InstanceProvider
Provides an instance using the _object injected in the constructor.
MethodProvider
Provides an instance using the _funcProvider method injected in the constructor.
MonoContext
An implementation of the IContext based on MonoBehaviour. This should be attached to a GameObject that has the _installer linked via the Unity inspector.
MonoInstaller
A MonoBehaviour based implementation of the interface IInstaller. Override this class to create your own MonoBehaviour based IInstaller. This should be linked via the Unity inspector for MonoContext.
TransientProvider
Provides an instance using the Type injected in the constructor and Activator to create a new instance every time.
Structs
BindIndex
Provides the index that can be used to lookup the IBinding in Container. This is based on a Type and id Object.
Interfaces
IBinder
Allows the creation and deletion of IBinding which is a mapping contract that contains optional information between a Type and a provider IProvider of a dependency denoted by the Type.
IBinding
IBinding allows mapping of a contract type contractType to an
IProvider that provides the dependency for the type. It contains extra information that enables
the IResolver to locate the correct IBinding and IProvider.
IBinding also contains convenient methods that allow us to chain method calls.
container.Bind<IEventService>().To<EventService>().AsSingle().Conclude();
IContainer
The combination of IResolver and IBinder and this should only be used in an IContext. Most of the time classes that require the dependency should only be using an IResolver to resolve the dependency. This is following the principle of Interface Segregation.
IContext
The IContext class hosts the dependency IContainer and the blueprints of most of the dependencies to its contract types. It uses the IInstaller during Bind() and Unbind() to setup and teardown the dependency graph in the IContainer.
IInjectable
The IInjectable interface enable a class to have its dependencies injected by the IInjector in the form of an IResolver.
IInjector
The IInjector injects the dependencies into the object.
IInstaller
An IInstaller is used by the IContext to Install(IContainer) and Uninstall(IContainer) the IBinding to the IContainer.
IProvider
IProvider provides an instance for the IBinding that contains this IProvider.
IResolver
An IResolver enables the dependency to be resolved based on the contract type and an optional id. This interface should not be cached in any object unless its a service level object.
Enums
Lifestyle
The scope of the instance that provided by the IProvider