How to manage discovery and composition as 2 separate concerns?

后端 未结 2 1811
野的像风
野的像风 2021-01-27 09:52

I have set up an assembly catalog:

  private CompositionContainer GetContainer() {
     // initialize directory info
     ExtensionDirectory = new DirectoryInfo(         


        
2条回答
  •  一生所求
    2021-01-27 10:08

    I think these concerns are already separated: discovery is handled by catalogs, and composition is done by export providers.

    In the typical case, you just pass a catalog directly to the container and for convenience it will automatically take care of creating an CatalogExportProvider for it.

    But you can also create one or more export providers yourself and pass them to the container with this constructor overload. (You may also have to set the SourceProvider to point back at the container after that, so that the export providers can use each other.)

    You can create your own ExportProvider implementations, and they don't even have to be backed by catalogs.

提交回复
热议问题