Skip to content

Stop using MEF as part of the public API #2422

Closed
@TomFinley

Description

@TomFinley

We have received feedback that we should limit our usage of MEF as part of the public API, according to feedback by .NET team. We currently for the sake of writing "custom" transformers have the user interact with it. This can be seen here.

newContext.CompositionContainer = new CompositionContainer(new TypeCatalog(typeof(CustomMappings)));

As we see, we are hsing on MLContext MEF containers and catalogs, using types exposing MEF Import and Export attributes, etc. etc. The feedback from .NET team is, stop, do something else, because MEF is apparently not "clean" enough.

(What is to be done instead? Possibly registering some "named" delegate to produce these things, or other. But anyway, we should not use MEF directly. Maybe not use attributes at all, and just require explicit registration somehow. I'm not sure.)

@eerhardt and others may have more specific recommendations or context on why we should not use MEF in this way.

Metadata

Metadata

Assignees

Labels

APIIssues pertaining the friendly API

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions