Question about loading class elements dynamically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anthony P.

    Question about loading class elements dynamically

    Hello Everyone,

    I'm totally lost and I hope someone can help me out or point me to
    something that can. Here's the deal:

    I have an application that will implement a 'plugin' archetecture of
    sorts. The application requires the user to fill out various forms.
    Each agency that we deploy the application to will have different
    forms and those forms will change over time. If we build each form
    into the application through hard code, changing, adding, or removing
    forms requires that the entire application be recompiled and
    reinstalled.

    So what I'm doing is designing the forms as part of a class library.
    So let's take filling out a log for example. I'll create a new class
    library and then add three Windows forms to it. Let's call them
    frmStep1, frmStep2, and frmStep3 (all which pass data amongst
    themselves). I build my class library and let's say that is called
    LogFormLib.dll. What I need to happen is that I can distribute this
    dll to my users, have them drop it in a special directory and have my
    application automatically pick it up and make it available via the
    menu system. This way, new forms can be added by simply distributing
    a new DLL that contains the code.

    I know this sounds easy, and I'm sure it is somewhat, but I am totally
    lost. How can I do this? Are there any tutorials?

    Thanks!
    Anthony

  • Michel Posseth  [MCP]

    #2
    Re: Question about loading class elements dynamically

    Easyest way in my opinion would be that you define a generic interface for
    the class in the by you descibed situatien if lots of changes might happen
    and you do not want to redeploy , i guess a invocation and comunication
    interface to your main app would be the way to go

    If you have defined this interface you can invoke anny plugin dll that
    contains this interface , so in basic the once defined invocation interface
    can never change cause then you need to redeploy your app however everything
    that is beyond the interface can be changed to anything you like

    to help you get started investigate "reflection " techniques

    HTH

    Michel Posseth [MCP]




    "Anthony P." <papillion@gmai l.comschreef in bericht
    news:bf6b4403-8637-4fc1-a2c4-785edd65c4ee@c6 5g2000hsa.googl egroups.com...
    Hello Everyone,
    >
    I'm totally lost and I hope someone can help me out or point me to
    something that can. Here's the deal:
    >
    I have an application that will implement a 'plugin' archetecture of
    sorts. The application requires the user to fill out various forms.
    Each agency that we deploy the application to will have different
    forms and those forms will change over time. If we build each form
    into the application through hard code, changing, adding, or removing
    forms requires that the entire application be recompiled and
    reinstalled.
    >
    So what I'm doing is designing the forms as part of a class library.
    So let's take filling out a log for example. I'll create a new class
    library and then add three Windows forms to it. Let's call them
    frmStep1, frmStep2, and frmStep3 (all which pass data amongst
    themselves). I build my class library and let's say that is called
    LogFormLib.dll. What I need to happen is that I can distribute this
    dll to my users, have them drop it in a special directory and have my
    application automatically pick it up and make it available via the
    menu system. This way, new forms can be added by simply distributing
    a new DLL that contains the code.
    >
    I know this sounds easy, and I'm sure it is somewhat, but I am totally
    lost. How can I do this? Are there any tutorials?
    >
    Thanks!
    Anthony
    >

    Comment

    • Anthony P.

      #3
      Re: Question about loading class elements dynamically

      Thank you Michael. This seems a bit complex but exactly what I need!
      So, I know how I'm going to spend my Sunday! lol

      Thanks Again,
      Anthony

      Comment

      • Anthony P.

        #4
        Re: Question about loading class elements dynamically

        Michael,

        I thought everything was going to be fine but I'm already confused so
        let me ask a few pointed questions if you don't mind. I think if I get
        these answered, I will be well on my way to properly using reflections
        and building my plugin archetcture:

        1. Do I define my interface in a seperate class file that will be
        included in my main applications project?

        2. What kinds of informatition do I need to put in my interface class?

        For example:
        Any given plugin will contain a bunch of Windows Forms that will
        interact with each other AND the main application that loads them. So
        let's say I have a menu item that loads form1 from an external dll
        file. Form1 will have multiple controls on it that will take data from
        the user and then call from2 (also contained in this external dll).

        The only cavaet is that each plug-in will need to access variables
        definied in the main application as Friends.

        3. If I understand this correctly, I will basically be doing three
        things:
        1. Creating my main application.
        2. Creating a SEPERATE class library that defines an interface
        (this dll will be distributed with my main app)
        3. Create seperate plugins that implement that interface.

        I suppose I am maybe getting a small understanding of how this is
        going to work but I still need a small bit of directlion.

        Thanks in Advance
        Anthony

        Comment

        • Steve Gerrard

          #5
          Re: Question about loading class elements dynamically

          Anthony P. wrote:
          Hello Everyone,
          >
          I'm totally lost and I hope someone can help me out or point me to
          something that can. Here's the deal:
          >
          I have an application that will implement a 'plugin' archetecture of
          sorts. The application requires the user to fill out various forms.
          Each agency that we deploy the application to will have different
          forms and those forms will change over time. If we build each form
          into the application through hard code, changing, adding, or removing
          forms requires that the entire application be recompiled and
          reinstalled.
          >
          So what I'm doing is designing the forms as part of a class library.
          So let's take filling out a log for example. I'll create a new class
          library and then add three Windows forms to it. Let's call them
          frmStep1, frmStep2, and frmStep3 (all which pass data amongst
          themselves). I build my class library and let's say that is called
          LogFormLib.dll. What I need to happen is that I can distribute this
          dll to my users, have them drop it in a special directory and have my
          application automatically pick it up and make it available via the
          menu system. This way, new forms can be added by simply distributing
          a new DLL that contains the code.
          >
          I know this sounds easy, and I'm sure it is somewhat, but I am totally
          lost. How can I do this? Are there any tutorials?
          >
          Thanks!
          Anthony
          It occurs to me that you might think of this application the other way around.

          If you build the "main" application as a dll, then you can build a series of
          custom executable apps that use that dll. All the main processing, and perhaps
          the main form, would be in the dll. Each custom app would use the dll, and
          include the specialized forms and processes it needs.

          I think that approach might make the whole thing easier to organize and
          implement, than trying to do a plug-in architecture.



          Comment

          • Gillard

            #6
            Re: Question about loading class elements dynamically





            "Anthony P." <papillion@gmai l.comwrote in message
            news:bf6b4403-8637-4fc1-a2c4-785edd65c4ee@c6 5g2000hsa.googl egroups.com...
            Hello Everyone,
            >
            I'm totally lost and I hope someone can help me out or point me to
            something that can. Here's the deal:
            >
            I have an application that will implement a 'plugin' archetecture of
            sorts. The application requires the user to fill out various forms.
            Each agency that we deploy the application to will have different
            forms and those forms will change over time. If we build each form
            into the application through hard code, changing, adding, or removing
            forms requires that the entire application be recompiled and
            reinstalled.
            >
            So what I'm doing is designing the forms as part of a class library.
            So let's take filling out a log for example. I'll create a new class
            library and then add three Windows forms to it. Let's call them
            frmStep1, frmStep2, and frmStep3 (all which pass data amongst
            themselves). I build my class library and let's say that is called
            LogFormLib.dll. What I need to happen is that I can distribute this
            dll to my users, have them drop it in a special directory and have my
            application automatically pick it up and make it available via the
            menu system. This way, new forms can be added by simply distributing
            a new DLL that contains the code.
            >
            I know this sounds easy, and I'm sure it is somewhat, but I am totally
            lost. How can I do this? Are there any tutorials?
            >
            Thanks!
            Anthony
            >

            Comment

            Working...