## The DEAT Business Rule Pattern Language

##### Russell R. Hurlbut, Ph.D.

Previous | Table of Contents |
Next
## Rule Pattern 28: Algorithm

**
**

**Problem – Describing a Mathematical Calculation
**

Almost all business processes involve some form of mathematical computation.
When the calculation is subject to some degree of variability, the aspects that
are subject to change need to be identified. Each piece of the algorithm must
be bound to a concrete value in order to compute the result within the context
of an individual calculation.

**
**

**Solution
**

Mathematical calculations that exhibit any degree of variability may be declared
as a parameterized algorithm type. Complex algorithms may require their own
domain specific language.

### Example – Highest X of Y

A company awards sales bonuses based upon the compensation of each eligible employee.
Since the actual calculation to determine the base compensation varies to some
degree, a generalized algorithm is used that is parameter driven. Typically the
highest year out of the last five is used, but for some types of seasonal salespersons
this is changed to the highest twelve consecutive months out of the last three
years or the highest eight months over the last two years.
##### Highest X of Y Parameters

*Parameter *
Set 1 |
*Included Periods* |
1 |

*Averaging Period* |
5 |

*Period Type* |
calendar year |

*Is Consecutive* |
True |

*Parameter *
Set 2 |
*Included Periods* |
12 |

*Averaging Period* |
36 |

*Period Type* |
calendar month |

*Is Consecutive* |
True |

*Parameter *
Set 3 |
*Included Periods* |
8 |

*Averaging Period* |
24 |

*Period Type* |
calendar month |

*Is Consecutive* |
False |

### UML Representation and Related Patterns

The Derivation business rule pattern maps to an Operation model element.

Previous | Table of Contents
| Next

###### Copyright 1998 Expertech.Ltd. All Rights Reserved.

Legal