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 3342310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:49:24+00:00 2026-05-18T00:49:24+00:00

I have a host application that controls various factory classes which produce implementations of

  • 0

I have a host application that controls various factory classes which produce implementations of a common data contract. Also, all the factories derive from a particular factory contract. The factories may need particular implementations of the data contract to generate their own objects… so the host can generically pass data via a function in the factory contract that has one argument of the data contract type. The factories then try to cast it to the type they are interested in… ignoring it if it doesn’t match. This all works ok so far.

I wanted to extend this to allow users to create add-in factories using the .NET add-in framework, but I’m concerned about the isolation boundaries… For instance, if a factory produces an IData instance, can another factory cast objects produced by the add-in to the shared concrete implementation type? It looks like the need for adaptors in the add-in pipeline may screw this up?

For instance, in the diagram below, the concrete class DataA would be shared between PluginA and PluginB, and the concrete class DataB would be shared between PluginB and PluginC.

alt text


Edit:
So far I only knew about the System.Addin functionality for creating add-ins… and the older methods involving direct reflection. I’ve just discovered MEF, which supposedly doesn’t concern itself with the isolation boundaries that are core to the System.Addin stuff. Does anyone with experience with MEF know how this might impact my scenario?

  • 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-18T00:49:25+00:00Added an answer on May 18, 2026 at 12:49 am

    So after some experimentation, I’ve found MEF can solve these problems. The isolation barriers created by System.Addins seem to make it impossible to retrieve the actual concrete implementation… MEF allows me to cast back discovered add-ins to their concrete types from addins that are aware of the specific implementations.

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

Sidebar

Related Questions

No related questions found

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.