CalcEngine Plus

User-authored calculations for .NET

Leveraging Hierarchies

Many applications contain hierarchical structures. Often these are rendered using some form of tree control, but sometimes in a planar view. All are composed of nodes with zero or more children.

Typically, tree nodes can be created, deleted and moved around. In instances where node values come from user-defined calculations, we often see a pattern where parent nodes represent some kind of aggregate (for example, the sum) over the child values.

Constructing a parent expression of the form "child1 + child2 + child3..." is a maintenance nightmare, doomed to failure as nodes are added and deleted.

CalcEngine Plus supports the "children" keyword, which means "all this children of this node". It operates with any of the variable-length aggregate functions. So your users can include constructions like "sum(children)", or "max(children)" in expressions configured against any parent node.