Learning - Extensibility: Dynamic loading, and any other no-recompile software updates

110 views Asked by At

I'm planning on writing a program but I am stuck in a conundrum. I don't want to start writing something and then have to rewrite it all when I find out that my program is not extensible. The other problem, is I do not have enough programming knowledge to know where to begin designing my program so that it is extensible.

I have done some reading on DLLs (or delayed loading for unix), dynamic loading, run-time library loading/deloading, etc.. but I still cannot quite comprehend what I need to do. I will give a sample program example, and if someone could lead me in the right direction for what to learn so my bigger program can begin, I will be extremely grateful!

Let's say I create a console program 'iAmDog' where you can type in commands, and the dog will respond accordingly with output to the console. Now let's assume when I create this program, the dog only has 1 command, 'bark' which produces the output 'roof roof!'. How would I go about writing this program so that while the user is still running the program, I can edit a library, or code somewhere else, to add a 'sit' command to the dogs repertoire.

Again, Ideally my plan is to have no downtime or as minimal downtime as possible, all while being able to code updates to functionality of the always running program.

Thank you for reading!

Russell aka SgtPooki

1

There are 1 answers

2
Marcel On BEST ANSWER

Are you using .NET? Then MEF, Managed Extensibility Framework, is probably suited well for you.

There is a podcast on Hanselminutes about MEF. You find an mp3 as well as a PDF transcript, that lets you search the show. They even discuss the possibility to continuously watch a folder for updates, to achieve what you descripbe, although they discourage to do this.