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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:12:03+00:00 2026-05-16T21:12:03+00:00

[I have read previous posts on MEF vs MAF vs DI etc, they aren’t

  • 0

[I have read previous posts on MEF vs MAF vs DI etc, they aren’t helping me with my specific problem]

I am looking to write a .Net application (probably console or Windoes service) which will be extensible. It is an overnight/schedule app to extract data from a database, do something with it, and then output it (or pass it on to another system).

I am unsure what the best way to define this process for plugins. The components are:

  • Task – definition of the actual task, containing plugin definitions, and event based flag on when to run (EOD,EOW,EOM)
  • Source – the source of the data (a task will have one to many sources), this could be a SQL query/stored proc, web service, or perhaps a file. I see this outputting a datatable.
  • PostProcess – the processing required to be done on the Source output (a task will have none to many post process steps), this could be an aggregator or some sort of specific processing). This would receive a dataset (containing the data table/s from the previous step). These would have to run in a specific order due to dependancies.
  • Target – the end result (also one to many), this could be a SQL statement/stored proc, a proprietary data load, email, output file or a web service

To simplify it I would prefer that the plugins could read from the config file, this would mean I wont need to know what connection strings (and other details) to pass to plugins.

I have looked at MEF, MAF, DI, or just defining my own framework. At this stage I am leaning towards developing my own, just wondered if I had missed anything?

I would actually like to use MEF, however as I need to define my task (ie. Task links to which Sources links to which PostProcess links to which Target), and also not having access to config. I have seen MEF Primatives and Type Catalogs get me part of the way, but doesn’t seem to help my chaining of plugins. Is MEF a valid choice?

  • 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-16T21:12:04+00:00Added an answer on May 16, 2026 at 9:12 pm

    MEF is definitely a valid choice. However, I dont think MEF was designed to be a fully fledged plug-in system, it is intended as a good starting point! MEF handles all the dirty assembly loading and disposing, but any specific pre-requisites need to checked manually. For this I would recommend using metadata. Metadata allows you to associate information with exports that can be read before you import them (MEF Metadata)

    [Export(typeof(ITask))]
    [ExportMetadata("Requires", "source1")]
    public class Task1: ITask
    {
        ...
    }
    

    Passing the config through with MEF is simple. The host application can export its self and all the plugins import it and have access to its interface. See my example below:

    Interface:

    public interface IMainApp
    {
        ConfigClass Config { get; set; } 
    }
    

    Host App:

    [Export(typeof(IMainApp))]
    public class Host : IMainApp
    {
        public Host()
        { /* Compose parts here..? */ }
    
        public ConfigClass Config { get; set; }  
    
        [Import(typeof(IModule))]
        public List<IModule> LoadedModules { get; set; }
    }
    

    Plug-in assembly:

    [Export(typeof(IModule))]
    public class Module : IModule
    {        
        public Module() { }
    
        [Import(typeof(IMainApp))]
        public IMainApp Host { get; set; } 
    
        public void DoSomething()
        {
            Host.Config... // use config here
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.