All components created within an Aspire installation have a name. Further, like files in a directory, a component name can be a simple name or a full path name.
This method for naming and referencing components provides enormous flexibility when creating your Aspire configurations and reusing components in multiple places.
The simple name for a component is specified when it is configured. For example, the simple name of the following component is simply "FetchUrl":
Note: The new standard is for all component names to start with a capital letter. This helps distinguish them from pipeline names, factory names, and subType names.
Names of Configuration Managers
The name of the top-level application is specified at the top of its Application Configuration file. For example, the name of the following configuration manager would be "FeedOneExample" :
Full Path Names
Since every component lives within some other, larger unit (either a component manager, a pipeline manager, or the Aspire application as a whole), all components can be uniquely referenced throughout the Aspire system with their full path name.
In the following example, the full path name for the "MyComponentManager" component manager is "/MyComponentManager" (note the leading slash).
Similarly, the full path name for the "FeedOne" component is "/MyComponentManager/FeedOne", since the "FeedOne" component lives within the scope of the "MyComponentManager" component manager.
As a more complex example, consider a component manager which contains a nested pipeline manager, as below:
The full path names for all of the components in the above example are as follows:
- /MyComponentManager - The application as a whole, a Component Manager
- /MyComponentManager/FeedOne - A feeder
- /MyComponentManager/MyPipeMgr - A pipeline manager
- /MyComponentManager/MyPipeMgr/FetchUrl - A pipeline stage
- /MyComponentManager/MyPipeMgr/GetCCDMeta - A pipeline stage
Relative References by Name
In the above example, there are two situations where components reference other components.
The first reference, also shown below, is a relative reference. Relative references (without the leading "/" slash) will reference components that exist within the same configuration manager or pipeline manager (i.e., within the same <components> tag).
In the case below, the feedOne component is referencing the pipeline manager using the relative reference "MyPipeMgr":
Note that relative references can also use "." and "..", just like with Unix file-path names.
Absolute References by Name
Components can also reference each other by absolute, full-path references. In the above example (also shown below), the "GetCCDMeta" component references the Content Control Database component by full path name.
<component name="GetCCDMeta" subType="default" factoryName="aspire-getccdmeta"> <ccdName>/SystemCommon/CCD</ccdName> <metadataMap> . . . </metadataMap> </component>
This example shows how a component can reference another component from some other configuration manager.
Implications and Uses
The methods for naming and referencing components within Aspire have many and various implications on the Aspire system.
- Configurations which use relative references are portable
- For example, a pipeline manager which contains relative references for all of the stages that it contains can be copied to other configuration files. The relative references ensure everything remains correctly "wired up".
- Shared resources can be referenced by absolute path names
- In the example above, the shared resource for the Content Control Database was created once and then shared amongst multiple component managers.
- All component names follow the same structure
- This includes, interestingly, pipeline stages, which usually reference components by the relative name. However, if you wanted to share a pipeline stage amongst multiple pipelines or component managers, you could do that with an absolute name, or a more complex relative name (such as "../../OtherPipelineStage").