lundi 6 juin 2016

Good Design Pattern for C# Calculation Engines

I am creating a calculation engine, calculation has 4 levels

  1. LevelA1 , A2
  2. LevelB
  3. LevelC
  4. LevelD

To calculate LevelA2 we need to calculate LevelD first and to calculate LevelD we need LevelC first output first and LevelB we need LevelA1.

Now During the calculation several intermediary values will be calculated at each level which we need to output at the end of calculations.

There are around 50 input fields(a collection of these fields) and almost similar count for the calculation output fields.

I would like to know a design pattern which is a best fit in this case. Few specific question:

  • During the calculations should I keep updating the input list during the calculations and output it since, final output is combination of inputs and outputs.
  • or Should I have separate classes for each level of outputs and pass that output to the next level as we progress?

Thanks In Advance!!!

Aucun commentaire:

Enregistrer un commentaire