Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Errr..... Plugin Architecture in Visual C# (kind of a rant, but more of a question, really...No wait, actually... It's just a question.)

Errr..... Plugin Architecture in Visual C# (kind of a rant, but more of a question, really...No wait, actually... It's just a question.)

Scheduled Pinned Locked Moved C#
questioncsharparchitecture
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Baeltazor
    wrote on last edited by
    #1

    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)

    H L 2 Replies Last reply
    0
    • B Baeltazor

      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)

      H Offline
      H Offline
      HuntingWabbits
      wrote on last edited by
      #2

      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...

      B 1 Reply Last reply
      0
      • H HuntingWabbits

        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...

        B Offline
        B Offline
        Baeltazor
        wrote on last edited by
        #3

        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 :)

        H 1 Reply Last reply
        0
        • B Baeltazor

          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 :)

          H Offline
          H Offline
          HuntingWabbits
          wrote on last edited by
          #4

          Yes thats pretty much it. I think this article might help: Plug-ins in C#[^]

          B 1 Reply Last reply
          0
          • H HuntingWabbits

            Yes thats pretty much it. I think this article might help: Plug-ins in C#[^]

            B Offline
            B Offline
            Baeltazor
            wrote on last edited by
            #5

            Thanks for your help HuntingWabbits :D That article was very helpful. Much appreciated. jase

            1 Reply Last reply
            0
            • B Baeltazor

              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)

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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

              B 1 Reply Last reply
              0
              • L Lost User

                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

                B Offline
                B Offline
                Baeltazor
                wrote on last edited by
                #7

                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

                L 1 Reply Last reply
                0
                • B Baeltazor

                  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

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups