views:

186

answers:

2

I have a system in place which applies calculations to a set of numbers (the specifics aren't really relevant). There are a number of sets of calculations which can be applied by the system users and new sets are added frequently. Currently when a new set of calculations need to be added to the system they are added in to the code base and a new version of the system released. I'd like to be able to add new calculation sets into the system without having to release a whole new version and also to have these new calculations become visible to system users automatically. Currently a new function is created for each set of calculations and a record containing the appropriate function name is added to a system table. These records are visible to system users (function names are aliased of course!) who then select them from a list. The system uses the Eval() function to run the appropriate calculations.

This is a VB6/Access app that I inherited and am currently re-writing in VB.NET and SQL Server.

Does anyone have any advice on how best to do this?

+3  A: 

Since you're redoing it in .Net, just put the calculations in plugins. Use reflection to load and examine these assemblies at runtime and present the user with functions.

Divil has a good (but fairly old now) article on writing plugin based applications. It will help you out: http://divil.co.uk/net/articles/plugins/plugins.asp (+ it's in VB.Net)

If you do it this way, all you have to do is drop a dll into the right directory and it just works.

Max Schmeling
A: 
Craig Norton