Maximize rule reuse through modularity
This presentation is part of the Reusability and Specialization e-Learning Course.
Transcript
For a rule to be reusable, all the steps of that rule must apply to a given situation. Breaking up a single rule into small rules can improve reusability by allowing smaller pieces of functionality to be used separately.
Think of each rule, especially activities, as their own mini-service that performs a logical group or function with expected inputs and outputs – and remember to document those expectations.
A developer has a requirement to build an activity that opens up all work objects with status “Pending Check, and for each of those objects in the list:
- Applies interest calculation and updates the object
- Formats a message and attaches it to the object
- Updates an external database with information about the process that just occurred
- Saves the object
If you create a single activity to do all the above, when another process that needs to do basically the same thing with perhaps a small change to the way the message is formatted, the developer would need to do a “Save As” and make a minor change to the rule. Repeating the same steps in multiple places, for example in two separate activities, should be avoided as much as possible, since it greatly increases the cost of maintenance.