I'm trying to identify design patterns (coding in TypeScript) or ideally example code to solve for evaluating business rules based on record data and performing actions such as changing field attributes, showing validation, or other static actions.
The existing code has lots of if/else statements in a single method and no object design at all. The rules are simple but numerous (100+).
The goals I'm trying to meet with this pattern include:
- Rule conflicts (two rules affecting the same component) are easy to identify
- Rules are grouped in a logical manner
- Rule criteria can be used on multiple rules and each rule can have multiple criteria
- Actions run by rules are reusable in other rules
- Low complexity and not overly obtuse to maintain
I worry I'm describing a very common problem so I apologize for that but my searches have not been fruitful so far.
I appreciate any help or direction regarding this.
Aucun commentaire:
Enregistrer un commentaire