Suggested enhancements to the CalculationEngine

Jul 23, 2009 at 12:50 AM


I would like to say that this project is great and that I've been following it for a while and I'm planning on using it in a future project. One aspect of my project will be to give my users an interface to update and change their Formulas. However, I need a Framework that can support this type of interface.

This has led me to some thoughts on ways to make the CalculationEngine in Flee transparent, more agile, and stay fully functional in any project someone wants to use it in.

First, and probably the easiest to implement would be the ability to rename Expressions already loaded to the CalculationEngine. It would need to also do a find and replace on it's precedents and dependents to prevent logic from breaking.

Next, and I don't even know if this will be possible, but create some attributes for properties, and if needed classes, that tie this properties to the CalculationEngine. This would allow users to use Flee's Calculation Engine in any project with extreme ease. This would probably require an interface that the class would have to inherit in order to properly work, but this type of approach would separate someones business layer up from their data layer.

One pit fall that keeps coming up is a way to handle the set method on the tagged property. I know through reflection that it's possible to tie an event to this when the value changes, but I haven't been successful. You would have the same problem if the Expression's name is set by another property.

Thanks for a wonderful project,


public class Worksheet : IExpressionContainer 
     private ExpressionContext _context; 

     // The Expression Attribute could except a string representing 
     // the formula's name or maybe even the name of another 
     // property containing the formula's name.) 
     public string Formula { get; set; } 

     // implemented from IExpressionContainer 
     public ExpressionContext Context { get; protected set; }