Decision table to rescue complex if conditions

·

1 min read

Refs:

Decision table - Wikipedia

https://capiro.co.uk/business-rules-with-decision-tables-basics/

https://www.codeproject.com/Articles/42732/Table-driven-Approach

Implementing a complicated decision table in JavaScript - Stack Overflow

http://jsfiddle.net/danw/h8CFe/

Use decision tables to write better tests faster | by eddyy stop | Medium

Decision Table Testing (Example) (guru99.com)

GitHub - seanpmaxwell/Trool: A rule engine for NodeJS written in TypeScript

GitHub - AlexanderSychev/decision-table: Simple implementation of Decision Tables

dmn-js: DMN viewer and editor | Toolkits | bpmn.io

DMN Modeling | Enterprise Architect Diagrams Gallery (sparxsystems.com)

GitHub - aw/ruby-decision-table: Parse a Decision Table in Ruby

Decision Table & Pattern Matching

“Pattern matching tests whether a given value (or sewwquence of values) has the shape defined by a pattern, and, if it does, binds the variables in the pattern to the corresponding components of the value (or sequence of values).”

https://www.bramstein.com/writing/pattern-matching.html

https://dev.to/gvergnaud/bringing-pattern-matching-to-typescript-introducing-ts-pattern-v3-0-o1k

https://levelup.gitconnected.com/using-pattern-matching-to-avoid-massive-if-statements-ce286e2f0ea5

https://www.michael-whelan.net/rules-design-pattern/

https://github.com/gvergnaud/ts-pattern#Parray-patterns

https://codesandbox.io/s/ts-pattern-examples-4wsh1c?file=/one-file-demo.ts:2492-2510

https://kyleshevlin.com/pattern-matching

https://github.com/CacheControl/json-rules-engine/blob/master/examples/03-dynamic-facts.js -> refactor to patterns

https://stackoverflow.com/questions/9266822/pattern-matching-vs-if-else/37018792#37018792

https://www.reddit.com/r/scala/comments/oq5pf2/comment/h6a0xpk/?utm_source=reddit&utm_medium=web2x&context=3

https://www.reddit.com/r/rust/comments/w625ur/comment/ihf3bkk/?utm_source=reddit&utm_medium=web2x&context=3