io.datakernel.di.core.InstanceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datakernel-di Show documentation
Show all versions of datakernel-di Show documentation
DataKernel has an extremely lightweight DI with ground-breaking design principles.
It supports nested scopes, singletons, object factories, modules and plugins which
allow to transform graph of dependencies at startup time without any reflection.
The newest version!
package io.datakernel.di.core;
/**
* A provider, unlike other DI frameworks, is just a version of {@link Injector#getInstance} with a baked in key.
* If you need a function that returns a new object each time then you need to make your binding {@link Binding#transiently transient}.
*
* The main reason for its existence is that it has a {@link io.datakernel.di.module.DefaultModule default generator}
* for its binding so it can be fluently requested by {@link io.datakernel.di.annotation.Provides provider methods} etc.
*
* Also it can be used for lazy dependency cycle resolution.
*/
public interface InstanceProvider {
Key key();
T get();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy