Expression Programming Concepts
The Expression Evaluator Engine (EEE) consists of the evaluation core logic, the ExpressionStore, and ExpressionEval objects, and caches for loaded expressions, object properties, and expression results as shown in the following figure.
Evaluation Contexts
Expression
Result
Cache
Object
Property
Cache
Evaluation
Core
Expression
Cache
Expression
Evaluation Engine
ExpressionEval
Object
Expression Store
Database
ExpressionStore
Object
External Programs
Using the EEE
The EEE consists of the following parts:
Evaluation Context
An evaluation context is used to evaluate a set of expressions against the same profiles. Performance is gained when evaluation contexts are used because it allows the EEE to do more intelligent caching. Specifically, it enables caching of profile properties and expression results. This is used by the CSF EvalTargetGroups component, for example, because this component evaluates many expressions against the same profiles and many of those expressions are commonly repeated in multiple target groups.
If an evaluation context is not explicitly created, one will automatically be created each time an expression is evaluated. Such context objects are automatically released once the expression has been evaluated.
Evaluation Core
This is the core logic of the EEE. It handles the actual evaluation of the expression.
Expression Cache
Expressions are loaded from the Expression Store into this cache. When an expression is to be evaluated, the ExpressionEval object firsts looks for the expression in this cache. If the expression is not found, it is loaded. For enhanced performance at run-time, pre-load expressions into the expression cache using the LoadExpr or LoadAll methods of the ExpressionEval object.
Expression Result Cache
The result of an evaluated expression is cached so the result can be returned without re-evaluating the expression a second time for a given evaluation context.
ExpressionEval Object
This object loads and flushes the expression cache, creates the evaluation contexts against which expressions are evaluated, and performs the evaluations on the expressions. For more information, see ExpressionEval Object.
ExpressionStore Object
This object interacts with the Expression Store to create, delete, save, retrieve, query, import, and export expressions. For more information, see ExpressionStore Object.
Object Property Cache
When an expression is initially evaluated, references to the dependent profile objects are stored in this cache. During evaluation, as the object properties are accessed, they are also stored in this cache for reuse.