There is N🚫 single best technique for rules modeling; each has its own specific applications, use cases, and pros and cons.
🔹Data annotation: A very basic type that allows validating the user inputs against missing values, invalid types, invalid range entries, etc. It has a very limited capability but very easy to define constraints around what is and is not accepted as inputs.
🔹Truth Table: A table has a simple match test in each cell, and the outcome of each rule is a single value of any type. Each row represents all possible conditions and outcomes. For simple scenario it may work, but business rules generally are more complex than that.
🔹Decision Table: Similar to the Truth Table, it is a tabular form, but it supports a wide range of tests from Unary tests on ranges, single value comparison, function calls, etc. It is a very capable and flexible type of rules modeling, allows defining a very wide range of business rules. When the conditions of rules are not shared between rules, it becomes very wide and hard to read.
🔹Natural language: It uses the concepts model and business glossaries to specify the context and terminologies of a domain and then uses those to define business rules in very easy-to-read and understandable forms. Potentially, the rule editor also allows writing rules by suggesting the correct terms, operations, and values. Some non-technical people feel it's a bit technical.
🔹Rule flow: Allows modeling business rules in a diagram, with diamond decision nodes for branching on different conditions. It looks familiar for people coming from a business process modeling space. In a sense, it is easy for many process professionals. However, it gets very complicated very soon and is not the best option.
🔹Tree: A form of tree structure that can grow horizontally or vertically, allowing users to create branches on each node and establish a hierarchy for connected conditions, and the last node of each branch becomes the action of the rule. Easy to build and understand; however, for a scenario, the Tree becomes very hard to maintain.
🔹Graph: A more flexible form of the Tree that allows sharing of conditions and actions for multiple rules. Very easy to navigate through different sets of rules and update them. However, for complex scenarios with more than a few dozen rules, it will become a nightmare to understand what is happening.
💣There is no one-fit-all modeling technique for business rules. Every technique has their own pros and cons, but…
🚀By decomposing business decisions into hierarchical decision units, you start with defining the decision scenario (the “what”) and then drill down to modeling the actual business rules (the “how”). In this approach then, you can use the right method for each individual decision unit in the Decision Graph and mix multiple techniques of rule modeling to make and execute a business decision.
#businessrules #javascript #csharp #java #rust #python #datascientists #data #developers
Posted here.
Published July 10th, 2024 at 07:30 am

