4 ms·
A key difference between pattern matching and decision tables is the intrinsic flexibility of the latter at the expense of simplicity the former provides. Wher
by AdieuToLogic 3y ago
A key difference between pattern matching and decision tables is the intrinsic flexibility of the latter at the expense of simplicity the former provides. Whereas pattern matching most often encodes branching statically by what is explicitly encoded, decision tables allow for runtime branching based on workflow context.
Both have their strengths and weaknesses and, IMHO, the choice as to which to use is situational.
Another related technique which employs a bit of both of these approaches is the Visitor pattern[0].
0 - https://en.wikipedia.org/wiki/Visitor_pattern https://en.wikipedia.org/wiki/Visitor_pattern