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. Interface? Abstract? DLL? Component? please help

Interface? Abstract? DLL? Component? please help

Scheduled Pinned Locked Moved C#
helpquestion
2 Posts 2 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.
  • S Offline
    S Offline
    sammyh
    wrote on last edited by
    #1

    I am creating an app, that needs numerous "drivers" the "drivers" are simple components that will accept a string, parse it and change some data in the main app. I want to be able to load all of the drivers from a directory at run-time. So I can just place a new one in the directory and run the app without re-compiling. Could someone please point me in the right direction. I am assuming each would go into their own DLL and be based on either an interface or a base class. But I still can't see the big picture and how they would load at run-time, or how they would fit into the main app. Thank you very much for any help.

    H 1 Reply Last reply
    0
    • S sammyh

      I am creating an app, that needs numerous "drivers" the "drivers" are simple components that will accept a string, parse it and change some data in the main app. I want to be able to load all of the drivers from a directory at run-time. So I can just place a new one in the directory and run the app without re-compiling. Could someone please point me in the right direction. I am assuming each would go into their own DLL and be based on either an interface or a base class. But I still can't see the big picture and how they would load at run-time, or how they would fit into the main app. Thank you very much for any help.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Interfaces or abstract classes are a start, but you really need a way to resolve the Type as well. This usually entails having a custom configuration section in your .config file that registers the Type associated with a particular operation, sort of how a Type to create for the <httpHandlers> section is associated with HTTP verbs and a path from which files that need to be handled are associated with the IHttpHandler or IHttpHandlerFactory. To make it easier, you should include yourl libraries either in your application's private path (the app's directory or any directory specified in your .config file under the configuration/runtime/assemblyBinding/probing section inside the privatePath attribute. For a good example, see the ASP.NET Web Matrix (a Microsoft employee-driven, free ASP.NET designer) at http://www.asp.net/[^]. There are also several good articles available here on CP about that cover this (though many use a proprietary configuration file, while I find using the .config file that is common to all runtime applications better). You just need to do a search. :)

      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

      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