-
Notifications
You must be signed in to change notification settings - Fork 7
Component Resolution
Pipelines are constructed using a set of components that are resolved using implementations of the following interface:
public interface IPipelineComponentResolver
{
T GetInstance<T>(string name) where T : IPipelineComponent;
}
The core framework only provides one implementation for IPipelineComponentResolver out of the box, DictionaryPipelineComponentResolver. If you would like to use a dependency injection (IOC) container for component resolution, please visit the Pipeline Framework Dependency Injection wiki page.
Both pipeline types AsyncPipeline<T> and Pipeline<T> provide two constructors which can be used to construct pipelines.
public AsyncPipeline(
IPipelineComponentResolver resolver,
IEnumerable<string> componentNames,
IDictionary<string, IDictionary<string, string>> settings)
public AsyncPipeline(
IPipelineComponentResolver resolver,
IEnumerable<Type> componentTypes,
IDictionary<string, IDictionary<string, string>> settings)
and
public Pipeline(
IPipelineComponentResolver resolver,
IEnumerable<string> componentNames,
IDictionary<string, IDictionary<string, string>> settings)
public Pipeline(
IPipelineComponentResolver resolver,
IEnumerable<Type> componentTypes,
IDictionary<string, IDictionary<string, string>> settings)
The first argument, IPipelineComponentResolver, is used to resolve any components that are requested. The second argument, IEnumerable<string> or IEnumerable<Type>, is used to instruct the resolver which components should be resolved and in what order. The third argument, IDictionary<string, IDictionary<string, string>>, provides configuration settings to the components.
When using IEnumerable<string> type as second argument, the framework will use each string as an argument to the resolver
method T GetInstance<T>(string name) directly. When using IEnumerable<Type>, the framework will use Name property of each Type.