Why is ExportAttribute sealed?

Feb 11, 2009 at 9:51 PM
If there's not a good reason to seal ExportAttribute, I'd like to see it unsealed. Teh word "Export" has no meaning to readers of my code. Other words would have meaning. I'd like to use derived attributes and have you find it via the base class.

I fear the answer is my writing a new programming model - which means I need to decide how important this would be.

So, for refernece, is creating a new programming model a matter of days or weeks? I heard it was hard.
Feb 11, 2009 at 9:58 PM

Hi Kathleen,

We’re aware of this scenario and definitely want to make it easier to handle at some point in the future.

ExportAttribute is sealed primarily for perf reasons, but also because we may want this dimension of extensibility to be more flexible than subclassing ExportAttribute would allow.

For now the answer is as you suspect – a custom programming model. There are examples and code available on the ‘net I believe that should make this task simpler than it appears. I would put this in the ‘days not weeks’ category, YMMV depending on what you want your PM to do.

HTH,

Nick

From: KathleenDOllard [mailto:notifications@codeplex.com]
Sent: Wednesday, February 11, 2009 1:51 PM
To: Nicholas Blumhardt
Subject: Why is ExportAttribute sealed? [MEF:46876]

From: KathleenDOllard

If there's not a good reason to seal ExportAttribute, I'd like to see it unsealed. Teh word "Export" has no meaning to readers of my code. Other words would have meaning. I'd like to use derived attributes and have you find it via the base class.

I fear the answer is my writing a new programming model - which means I need to decide how important this would be.

So, for refernece, is creating a new programming model a matter of days or weeks? I heard it was hard.

Read the full discussion online.

To add a post to this discussion, reply to this email (MEF@discussions.codeplex.com)

To start a new discussion for this project, email MEF@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Feb 11, 2009 at 11:08 PM
Nick,

OK, that seems reasonable

Kathleen
Feb 12, 2009 at 8:55 AM
Kathleen,

I'll be releasing the first preview version of my custom programming model in a couple of days (finishing up some tests and refactoring). It's built on an open model for providing definitions, i.e you inherit a base class, which exposes one public method, and of you go to build your definition provider. I did a spike a couple of hours ago and using less than 150 lines of code I was able to add support for custom attributes ontop of my model. The model will be available on MEFContrib as open-source.

On the note of building a custom model for MEF. It's not hard, in programming terms - the difficulties is to understand the composition process of MEF, once you've got that nailed the rest is pretty trivial.
Feb 12, 2009 at 6:35 PM
CodeJunkie,

That sounds great. I look forward to walking through your model.

Kathleen