Reputation: 1165
i'm working on a webapplication written in C# using the ASP.NET MVC framework.
I want to allow my clients to write their own plugins for the web application. Each client get it's own database.
I got some ideas how to do this:
How can i allow the user to write a plugin? I mean how to provide some kind of SDK for this? The user primary needs the C# interfaces and Annotations but the developer also want's to test the plugin before uploading it to the production server. Can i pack my webapplication in some kind of DLL which could be loaded by the developer for testing purposes but not read the source code? Or is there any other way of doing this?
Thank you for any info on this!
Upvotes: 2
Views: 2639
Reputation: 12786
You should take a look at MEF (Managed Extensibility Framework) this is a framework Microsoft created to enable applications for plugins.
In short: You create a library with contracts (interfaces). You give that library to your customers and tell them to write plugins based on those interfaces.
Then you tell your application that when it needs IPlugin
it needs to search the plugin folder for an implementation of IPlugin
and use that.
Some research urls:
Upvotes: 3