Using MEF's inherited export

342 views
Skip to first unread message

Glenn Block

unread,
Apr 2, 2010, 11:55:28 PM4/2/10
to wpf-di...@googlegroups.com
MEF has a really nice little gem of a feature called InheritedExport.
It les you put an InheritedExport attribute on an interface or a base,
which autoimatically propagates to inheritors / implementers. Ideal
for meffing up existing framework libraries without pushing an MEF
details to the consumer.

Ward just did a great post on how they are using it for extensibility
in IdeaBade. Retweet below:

Posted: "DevForce Extensibility With MEF InheritedExport"
http://bit.ly/bDcFIQ . Thanks for the tip, @gblock

sent via Seesmic in reply to @gblock
On Twitter: http://twitter.com/wardbell/status/11513057727

You really want to add this to your MEF paraphenalia list.

Glenn

--
Sent from my mobile device

Mark Smith

unread,
Apr 3, 2010, 12:01:47 AM4/3/10
to wpf-di...@googlegroups.com
Ohhhh... sweeeet! I didn't realize you could do this! It opens up all kinds of wonderful possibilities without the nasty attributes being applied everywhere! Thanks for the tip Glenn...

mark

> --
> To unsubscribe, reply using "remove me" as the subject.

Glenn Block

unread,
Apr 3, 2010, 12:05:59 AM4/3/10
to wpf-di...@googlegroups.com
Yes, it works great as long as there are no imports. If there are
imports you can use the Import/ImportingConstructor with
InheritedExport.

Peter O'Hanlon

unread,
Apr 3, 2010, 5:10:40 AM4/3/10
to wpf-di...@googlegroups.com
I rely heavily on InheritedExport. I don't want a client to have to know that they have to do anything clever to replace our code; just implement an interface and *bang* job done.

--
To unsubscribe, reply using "remove me" as the subject.



--
Peter O'Hanlon

Pavan Podila

unread,
Apr 3, 2010, 9:15:35 AM4/3/10
to wpf-di...@googlegroups.com
This is brilliant. Just what I wanted.

InheritedExport + DefaultExport..... FTW

-----------------------------------
Pavan Podila
http://blog.pixelingene.com

Reply all
Reply to author
Forward
0 new messages