I am currently writing a plugin for CAD style software. The plugin performs calculations based on data read from the CAD model and a large number of searches in the table (think of printed tables in the calculation guide). I inherited this plugin, and the current solution defines a class Constantthat has a bunch of static structure elements and two-dimensional arrays. Then these arrays are indexed by enumeration values at runtime to find the corresponding data.
I am not very happy with the decision, because the representation in the class is Constantquite difficult to read - the enumeration values used when extracting the data are, of course, not visible when editing the data (although this only ever happens manually and very rarely).
I would prefer not to associate DB (and the engine) with a small plugin, but I would like to use similar semantics, for example, using LINQ to select values where some fields match, etc.
What is your preferred solution to this problem?
- Do you use a bunch of XML files and parse them at runtime?
- Do you use the template engine (t4?) To generate classes from XML files at compile time?
- You store XML versions of datasets in resources (read them at runtime, LINQ to dataset ...)
Constants, , ( - ...)