This project has moved and is read-only. For the latest updates, please go here.

Linking Exports

Dec 22, 2008 at 9:08 PM
I am wondering how the MEF handles linking related exports together (if at all)? For instance, I have 2 classes that implement IPaymentProvider and these classes require additional metadata (username, password, security token) to work with the service provider. So, in this case, I can drop in the MyPaymentProvider and have it discovered by the application, but there also needs to be a tie-in to the required configuration control that will allow the user to enter the required metadata and save it off, so when I select to configure MyPaymentProvider, it will load the appropriate control. I can do this through custom attributes or, right now, I do it via a db entry - but with dynamic composition, it seems like there should be some way to link required parts together.
Dec 22, 2008 at 9:20 PM
Are you sure that username, pwd and sec token are metadata? Metadata is secondary information and MEF uses metadata maily for discrimination of imports. What you describe is primary. I'd think they are parameters or configuration.
Dec 23, 2008 at 2:03 PM
Yep, you are right. Sorry for the confusion.
Jan 2, 2009 at 9:48 PM
The linking is conceptual, not really required - nevermind. :)