Skip to content

Any chance to integrate functionality from System.ComponentModel.Composition? #15362

@ZigMeowNyan

Description

@ZigMeowNyan

A lot of System.Composition code has been merged recently, and lines up with the MEF 2 code from codeplex. Is any of the code from System.ComponentModel.Composition likely to be integrated? I have an old codebase that I've been refactoring and splitting out into separate components, and for some scenarios, I've had to use System.ComponentModel.Composition instead of the System.Composition package available from Nuget.

The main justification behind our switch was that the CompositionContainer supports ComposeExportedValue<T>(T exportedValue) while the CompositionHost doesn't. Being able to explicitly export an existing object instance can be useful when the full architecture isn't adjustable. While it's not exactly the purest of approaches, in some scenarios a little flexibility goes a long way. System.Composition "has been optimized for static composition scenarios and provides faster compositions". There are some scenarios where the alternative structure is a better fit, if less streamlined. We've also considered making this project cross-platform, which makes its presence in the OSS .NET Core desirable for us.

I bring this up because System.ComponentModel is marked as "done" on the progress chart, but System.ComponentModel.Composition isn't listed at all. With the integration of System.Composition, I'm concerned that this is something that's not even being considered and it might end up ignored by default.

This also brings up the concern of whether merging namespaces would be feasible. Having multiple namespaces around isn't exactly ideal from a usability perspective, but changing them would be a compatibility issue. It's also possible that there's some code duplication between the two, at least as far as the attributes go. Discarding the old namespace for us is feasible - we want it for the functionality, but we're not attached to the namespace and are open to recompiling.

If I've somehow missed the introduction of equivalent functionality, please enlighten me.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions