Errr..... Plugin Architecture in Visual C# (kind of a rant, but more of a question, really...No wait, actually... It's just a question.)
-
Hi everyone! ...From what I can understand, it's that the whole C# Plugin Architecture thing isn't as good as I thought it would be. I first came up with an idea to (somehow) develop my application in such a way that it would be possible to add functionality at a later time without actually having to go back into the main application project and edit/add code to it, and to also be able to add ANY feature at all (limited only to the imagination.) I would have liked to simply create a DLL (or whatever) and send it to a user and say "Hey man, add this to the "MyApplication" directory and then open "MyApplication". But, out of the 9 articles I've read online, it's become quite apparent that you cannot do that. In order to make a "plugin" work with your program, you must tell your program to look for it. In other words, your program will be 'expecting' "this" plugin. And if you try to open a different plugin that isn't described in your application, it won't work. I think I might be a little crazy, but I also think that I'm right, going by the 9 articles I've read in the past week. Unless I've misunderstood all 9 articles... :laugh: Can anyone please shed a little light on this for me? Thanks, schizophrenic PrOgRaMmEr (formerly jase, jt and jay)
-
Hi everyone! ...From what I can understand, it's that the whole C# Plugin Architecture thing isn't as good as I thought it would be. I first came up with an idea to (somehow) develop my application in such a way that it would be possible to add functionality at a later time without actually having to go back into the main application project and edit/add code to it, and to also be able to add ANY feature at all (limited only to the imagination.) I would have liked to simply create a DLL (or whatever) and send it to a user and say "Hey man, add this to the "MyApplication" directory and then open "MyApplication". But, out of the 9 articles I've read online, it's become quite apparent that you cannot do that. In order to make a "plugin" work with your program, you must tell your program to look for it. In other words, your program will be 'expecting' "this" plugin. And if you try to open a different plugin that isn't described in your application, it won't work. I think I might be a little crazy, but I also think that I'm right, going by the 9 articles I've read in the past week. Unless I've misunderstood all 9 articles... :laugh: Can anyone please shed a little light on this for me? Thanks, schizophrenic PrOgRaMmEr (formerly jase, jt and jay)
Yes, your application must know about plugins. But if those plugins conform to a common interface, then your application will know what to do with them. When I wrote a plugin system a couple of years back it used interfaces. The main application would scan a directory for DLL's, use reflection to see what interfaces they implemented, and if they used the interface I was expecting, then I would load the DLL and use it. I'm pretty sure there are articles on this site describing a similar method...
-
Yes, your application must know about plugins. But if those plugins conform to a common interface, then your application will know what to do with them. When I wrote a plugin system a couple of years back it used interfaces. The main application would scan a directory for DLL's, use reflection to see what interfaces they implemented, and if they used the interface I was expecting, then I would load the DLL and use it. I'm pretty sure there are articles on this site describing a similar method...
Yay thanks for your quick reply! :D So, if my application 'knows' about plugins that conform to a particular interface for example a "Drawing Interface"...? I could create plugins that enable the user to View a photo and another to Edit a photo..? I mean, my application only needs to know what "type" of plugin it will be, correct? Not "exactly" what it will do? Thanks for yout time :)
-
Yay thanks for your quick reply! :D So, if my application 'knows' about plugins that conform to a particular interface for example a "Drawing Interface"...? I could create plugins that enable the user to View a photo and another to Edit a photo..? I mean, my application only needs to know what "type" of plugin it will be, correct? Not "exactly" what it will do? Thanks for yout time :)
Yes thats pretty much it. I think this article might help: Plug-ins in C#[^]
-
Yes thats pretty much it. I think this article might help: Plug-ins in C#[^]
-
Hi everyone! ...From what I can understand, it's that the whole C# Plugin Architecture thing isn't as good as I thought it would be. I first came up with an idea to (somehow) develop my application in such a way that it would be possible to add functionality at a later time without actually having to go back into the main application project and edit/add code to it, and to also be able to add ANY feature at all (limited only to the imagination.) I would have liked to simply create a DLL (or whatever) and send it to a user and say "Hey man, add this to the "MyApplication" directory and then open "MyApplication". But, out of the 9 articles I've read online, it's become quite apparent that you cannot do that. In order to make a "plugin" work with your program, you must tell your program to look for it. In other words, your program will be 'expecting' "this" plugin. And if you try to open a different plugin that isn't described in your application, it won't work. I think I might be a little crazy, but I also think that I'm right, going by the 9 articles I've read in the past week. Unless I've misunderstood all 9 articles... :laugh: Can anyone please shed a little light on this for me? Thanks, schizophrenic PrOgRaMmEr (formerly jase, jt and jay)
schizophrenic.prOgrAmmEr wrote:
C# Plugin Architecture
You might also want to take a look at the Managed Extensibility Framework http://www.codeplex.com/MEF[^]
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here
-
schizophrenic.prOgrAmmEr wrote:
C# Plugin Architecture
You might also want to take a look at the Managed Extensibility Framework http://www.codeplex.com/MEF[^]
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here
-
Hmmm... That's very interesting. I'm always on CodePlex, I'm surprised I haven't already found it. Thanks for that Wes Aday! :) I'm reading about it now and will check it out. Oh the excitement!! :D
You are welcome. Hope you find it useful.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here