-1

I'm building an extensible service application for my work, and the way it 'extends' is by loading DLL's and executing methods within. It is designed this way so that I do not need to recompile and re-deploy every time we have a new job for it to do. Currently, the service loads a DLL using Assembly.LoadFrom() and then it registers the assembly with the service. In the registration, a Func<object, bool> is passed that dictates the entry point for the new job.

My question is would it be better if I created the instance every time I needed to run the task via something similar to this:

IRunable run = (IRunable)asm.CreateInstance(t.FullName, true);
run.Run();

or would it be better to do it the way I am currently, where I store the Func<> in a class that is called based of a timer?

Jacob Lambert
  • 7,449
  • 8
  • 27
  • 47

1 Answers1

0

Timer!

If the performance might stuck because of it (i always had this problem in c#) u can still change it, but a timer gives you more controll over the programm itself...

But implementing a buffer should also just work fine

user31911
  • 76
  • 8
  • Would using a timer to call the creation of the instance give the best of both worlds? Or is that overkill? – Jacob Lambert Aug 25 '14 at 14:45
  • a timer is always safe, just i'd had to test it myself u have to show me more code to answer it precisly, since all in programming is situational... i understand it is for work, but nobody can help you if you wont show anything :D – user31911 Aug 25 '14 at 15:03