Package com.pyranid
Interface InstanceProvider
- All Known Implementing Classes:
DefaultInstanceProvider
public interface InstanceProvider
Contract for a factory that creates instances given a type.
Useful for resultset mapping, where each row in the resultset might require a new instance.
Implementors are suggested to employ application-specific strategies, such as having a DI container handle instance creation.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
-
Method Details
-
provide
Provides an instance of the giveninstanceClass
.Whether the instance is new every time or shared/reused is implementation-dependent.
- Type Parameters:
T
- instance type token- Parameters:
instanceClass
- the type of instance to create- Returns:
- an instance of the given
instanceClass
-