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

  • Home
  • SEARCH
  • 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 7909929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:39:43+00:00 2026-06-03T12:39:43+00:00

I finally started toying around with MEF only to find it was less straightforward

  • 0

I finally started toying around with MEF only to find it was less straightforward to solve my flagship problem.

Problem:
I have a WCF service that relies on some custom algorithms each living in their own assemblies. When a method is called, part of the request’s data contract will identify which algorithms are needed. For example class One and class Two each implement a NameFile() method while classes A and B each implement EncryptFile().

One call to the service’s WriteFile() may need to call Two.NameFile and A.EncryptFile, while another may need One.NameFile and B.EncryptFile.

Attempts: MEF (I’m new to it) seemed a nice way to load up assemblies but what I’ve found so far seems as though I need to go through a number of steps to determine at runtime which of the available contract-meeting assemblies fits the need. Plain Old Reflection seems to be a more straightforward way to decide and load when the specific need is only known during a call.

Question Is MEF indeed more suited to other dynamic loading scenarios or is it just my MEF noobism?

Thanks,

John

  • 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-06-03T12:39:45+00:00Added an answer on June 3, 2026 at 12:39 pm

    Is MEF indeed more suited to other dynamic loading scenarios or is it just my MEF noobism?

    Well, the main issue is determining, at runtime, which of the options which fulfill the contract you wish to use.

    This determination will have to occur no matter what you choose – whether it’s MEF, some other injection mechanism, or rolling your own version with reflection.

    MEF should still make this simpler than rolling your own version, however, as it’s easy to use [ImportMany] to import all IFileEncryptor (or whatever) implementations from all available assemblies. At that point, determining the correct one from the list of available should be fairly simple.

    While, using reflection, you could just go grab the specific type from the specific assembly – that really defeats the purpose of doing this dynamically. MEF makes it easy to extend this service without recompilation or code changes, since you can drop a new assembly in place and have it automatically discoverable.

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

Sidebar

Related Questions

I have finally started messing around with creating some apps that work with RESTful
I've finally started to learn PHP and I quite have trouble with it. I
I have finally started to take the time out to grok the continuous integration
I have an annoying and unfortunately urgent problem. I started out by trying to
I've started working with ASP.net AJAX (finally ☺). and I've got an update panel
Ok, so I've finally bowed to peer pressure and started using Spring in my
Recently in our work, I've started getting some experience with SEO (finally). It's something
I finally have my C++ Builder 2010 installation the way I want it, with
I started learning haskell yesterday and I got stuck on a problem. After a
I have a console application (VB.NET). When it is started, it spawns worker threads

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.