I’m writing an ASP.NET MVC 2 application where developers could extend it with plugins. I’ve started to consider how create a plugin system. (e.g. like Joomla’s)
I have some doubts about how to do this. I have searched over the net and I found that there are two potential solutions.
using interfaces or abstract classes to implement methods and a plugin-structure, load the assembly, cast the object to the interface and call the methods that the plugins should have when i need to hook the system.
using C# events to load the assembly and raise the events where I need to hook the system. The plugin in the constructor will register the function with the event provided by my application.
What is the best solution? What performance considerations are there? What other approaches could there be?