动态服务选择——选择调用多个具有相同接口的组件中的哪一个。
Dynamic service selection - Chooses which of multiple components with the same interface to invoke.
然后存储卡就可以选择扩展,并且业务组件实现可以用于相同的范围。
Then the extension can be picked up by the registry, and the business component implementation is available in the same scope.
我们也可以为组件和导入使用不同的接口,但本文为了简单起见,选择了使用相同的接口。
We could also have used different interfaces for the component and the import — but for simplicity in this article, we have opted to make use of the same interface.
Selector组件为调用具有相同接口的组件提供一种选择机制。
The Selector component provides a selection mechanism for invoking components that have the same interface.
选择器的目标可以是相同模块的组装关系图中的组件,或另一个模块的导出。
The destination of a selector can be a component inside the assembly diagram of the same module or an export of another module.
因为该组件与我们所希望的目标Export具有相同的绑定类型,所以右键单击组件并选择SelectServiceTo Import。
Now that this component has the same binding type as the Export that we wish to target, right-click the component and select select Service to Import.
因为该组件与我们所希望的目标Export具有相同的绑定类型,所以右键单击组件并选择SelectServiceTo Import。
Now that this component has the same binding type as the Export that we wish to target, right-click the component and select select Service to Import.
应用推荐