Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 292877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:13:14+00:00 2026-05-12T06:13:14+00:00

Brief Background: My team has decided to use Microsoft’s Managed Extensibility Framework ( MEF

  • 0

Brief Background:

My team has decided to use Microsoft’s Managed Extensibility Framework (MEF) in order to provide an extensible model for adding new “providers” into our system.

This allows for us to plug in new 3rd party providers with relative ease.

Note: I was impressed by how simple MEF was to use and get up and running with.

My Question:

Since these providers commonly have different properties associated with them, when loading these providers into the system at run-time we need to access the providers data streams and properties.

What approach should be taken in order to work with said provider plug-ins due to the differing properties? Noting they all do a similar job.

My Solution:

Create an interface which the providers must conform to, resulting in a “wrapper” being created around each of the 3rd party providers resulting in a consistent interface /
programming model for working with each provider.

Plug-in = 3rd party data source (provider) + Common interface implementation.

+ve:
No need for a more complex reflection based dynamic “plug” for said plug-ins.

-ve:
Have to write a wrapper for each provider. (We need to add the MEF Export tags regardless)

Further Note:

To me the interface / wrapper approach would be the simplest but I have been told to investigate a reflection based approach which may utilize reflection in order to discover the properties at run-time which can be exposed to the system.

I am not in favor of any one solution over another, but I would be interested in hearing the thoughts of the community (most of which are more experienced than I).

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:13:14+00:00Added an answer on May 12, 2026 at 6:13 am

    It’s not very clear what “properties” and “data streams” are you talking about, but still.

    Yes, common interface is always a good thing. And since you have all these “properties” and such, I suggest the following:

    interface IProperty
    {
        string Name { get; }
        object Value { get; }
    }
    
    interface IDataStreamProvider
    {
        Stream OpenStream();
    }
    
    interface IPlugin
    {
        ReadOnlyCollection<IProperty> Properties { get; }
    
        ReadOnlyCollection<IDataStreamProvider> DataStreams { get; }
    }
    

    Speaking of “wrappers”: I do not understand the intent of those. All third-party plugins must implement IPlugin interface and must be decorated with either ExportAttribute or PluginAttribute as in this:

    class PluginAttribute : ExportAttribute
    {
        public PluginAttribute() :
            base(typeof(IPlugin))
        {
        }
    }
    

    Reflection should be avoided as much as possible because of maintainability concerns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Uhm I'm not sure if anyone has encountered this problem a brief description is
In brief: Is it ever excusable to have assembly names and class names stored
I happened upon a brief discussion recently on another site about C# runtime compilation
Could somebody give me a brief overview of the differences between HTTP 1.0 and
I'll try to be brief. What is the best practice for calling a routine
Let's put Heisenberg aside for a brief moment. How would I go about to,
I'm going to be brief because I'm short on time, so I apologize if
The question, in brief: In MVC, how do you distinguish between a checkbox click
Basically, I would like a brief explanation of how I can access a SQL
Guys, can someone give me a brief run through of how to change the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.