Correct use of the reference expression is key to the structure of a good CER rule set. Use of reference goes hand-in-hand with creating the right number of rule attributes. The CER Editor provides different types of scenarios to create and use the rule reference element. See "rule" item in Rule.
Striking the right balance (between too few uses of reference and too many) is perhaps more art than science; however, here are some general guidelines:
- If you find that some of your expressions are nested very deeply or are otherwise complex, then you may have too few references. Consider breaking up complex expressions by creating rule attributes for a meaningful block of expressions, and using a reference to the new rule attribute instead.
- If your requirements have a strong concept or calculation which does not map neatly to a rule attribute, then you should consider creating such a rule attribute.
- If several expressions repeat the same kind of calculations, then your rule set might benefit from the creation of a rule attribute to implement the common logic.
- If you find a rule attribute is difficult to name, then the rule attribute might be an unnecessary encapsulation of logic, and you might have too many uses of reference in your rule set. Consider removing the rule attribute and "inlining" its derivation in the places where it is used, especially in the case where the rule attribute is only referenced from one other calculation.