Pip-Services-Commons-Dotnet
|
Interface for a map that holds component references and passes them to components to establish dependencies with each other. More...
Public Member Functions | |
void | Put (object locator, object component) |
Puts a new component reference to the set with explicit locator More... | |
object | Remove (object locator) |
Removes a previously added reference that matches specified locator. If many references match the locator, it removes only the first one.When all references shall be removed, use removeAll() method instead. More... | |
List< object > | RemoveAll (object locator) |
Removes all component references that match the specified locator. More... | |
List< object > | GetAllLocators () |
Gets locators for all registered component references in this reference map. More... | |
List< object > | GetAll () |
Gets all component references registered in this reference map. More... | |
List< object > | GetOptional (object locator) |
Gets all component references that match specified locator. More... | |
List< T > | GetOptional< T > (object locator) |
Gets all component references that match specified locator and matching to the specified type. More... | |
List< object > | GetRequired (object locator) |
Gets all component references that match specified locator. At least one component reference must be present.If it doesn't the method throws an error. More... | |
List< T > | GetRequired< T > (object locator) |
Gets all component references that match specified locator. At least one component reference must be present and matching to the specified type. More... | |
object | GetOneOptional (object locator) |
Gets an optional component reference that matches specified locator. More... | |
T | GetOneOptional< T > (object locator) |
Gets an optional component reference that matches specified locator and matching to the specified type. More... | |
object | GetOneRequired (object locator) |
Gets a required component reference that matches specified locator. More... | |
T | GetOneRequired< T > (object locator) |
Gets a required component reference that matches specified locator and matching to the specified type. More... | |
List< object > | Find (object locator, bool required) |
Gets all component references that match specified locator. More... | |
List< T > | Find< T > (object locator, bool required) |
Gets all component references that match specified locator and matching to the specified type. More... | |
Interface for a map that holds component references and passes them to components to establish dependencies with each other.
Together with IReferenceable and IUnreferenceable interfaces it implements a Locator pattern that is used by PipServices toolkit for Inversion of Control to assign external dependencies to components.
The IReferences object is a simple map, where keys are locators and values are component references.It allows to add, remove and find components by their locators.Locators can be any values like integers, strings or component types. But most often PipServices toolkit uses Descriptor as locators that match by 5 fields: group, type, kind, name and version.
See Descriptor, References
List<object> PipServices3.Commons.Refer.IReferences.Find | ( | object | locator, |
bool | required | ||
) |
Gets all component references that match specified locator.
locator | the locator to find a reference by. |
required | forces to raise exception is no reference is found |
Implemented in PipServices3.Commons.Refer.References.
List<T> PipServices3.Commons.Refer.IReferences.Find< T > | ( | object | locator, |
bool | required | ||
) |
Gets all component references that match specified locator and matching to the specified type.
T | the class type |
locator | the locator to find a reference by. |
required | forces to raise exception is no reference is found |
Implemented in PipServices3.Commons.Refer.References.
List<object> PipServices3.Commons.Refer.IReferences.GetAll | ( | ) |
Gets all component references registered in this reference map.
Implemented in PipServices3.Commons.Refer.References.
List<object> PipServices3.Commons.Refer.IReferences.GetAllLocators | ( | ) |
Gets locators for all registered component references in this reference map.
Implemented in PipServices3.Commons.Refer.References.
object PipServices3.Commons.Refer.IReferences.GetOneOptional | ( | object | locator | ) |
Gets an optional component reference that matches specified locator.
locator | a locator to find a reference |
Implemented in PipServices3.Commons.Refer.References.
T PipServices3.Commons.Refer.IReferences.GetOneOptional< T > | ( | object | locator | ) |
Gets an optional component reference that matches specified locator and matching to the specified type.
T | the class type |
locator | a locator to find a reference |
Implemented in PipServices3.Commons.Refer.References.
object PipServices3.Commons.Refer.IReferences.GetOneRequired | ( | object | locator | ) |
Gets a required component reference that matches specified locator.
locator | a locator to find a reference |
Implemented in PipServices3.Commons.Refer.References.
T PipServices3.Commons.Refer.IReferences.GetOneRequired< T > | ( | object | locator | ) |
Gets a required component reference that matches specified locator and matching to the specified type.
T | the class type |
locator | a locator to find a reference |
Implemented in PipServices3.Commons.Refer.References.
List<object> PipServices3.Commons.Refer.IReferences.GetOptional | ( | object | locator | ) |
Gets all component references that match specified locator.
locator | a locator to find references by |
Implemented in PipServices3.Commons.Refer.References.
List<T> PipServices3.Commons.Refer.IReferences.GetOptional< T > | ( | object | locator | ) |
Gets all component references that match specified locator and matching to the specified type.
T | the class type |
locator | the locator to find references by. |
Implemented in PipServices3.Commons.Refer.References.
List<object> PipServices3.Commons.Refer.IReferences.GetRequired | ( | object | locator | ) |
Gets all component references that match specified locator. At least one component reference must be present.If it doesn't the method throws an error.
locator | a locator to find references |
Implemented in PipServices3.Commons.Refer.References.
List<T> PipServices3.Commons.Refer.IReferences.GetRequired< T > | ( | object | locator | ) |
Gets all component references that match specified locator. At least one component reference must be present and matching to the specified type.
If it doesn't the method throws an error.
T | the class type |
locator | a locator to find references |
Implemented in PipServices3.Commons.Refer.References.
void PipServices3.Commons.Refer.IReferences.Put | ( | object | locator, |
object | component | ||
) |
Puts a new component reference to the set with explicit locator
locator | a locator to find the reference by |
component | a component reference to be added |
Implemented in PipServices3.Commons.Refer.References.
object PipServices3.Commons.Refer.IReferences.Remove | ( | object | locator | ) |
Removes a previously added reference that matches specified locator. If many references match the locator, it removes only the first one.When all references shall be removed, use removeAll() method instead.
locator | a locator to find the reference to remove |
Implemented in PipServices3.Commons.Refer.References.
List<object> PipServices3.Commons.Refer.IReferences.RemoveAll | ( | object | locator | ) |
Removes all component references that match the specified locator.
locator | a locator to remove the reference by |
Implemented in PipServices3.Commons.Refer.References.