Used this slide in a presentation, today, and thought I would ask here if anyone had any thoughts, good, bad, or indifferent, on it:
The basic concept is that in Rules as Code you want to isolate the legal reasoning from the application, so that the legal reasoning tool can be re-used in many different applications, and for many different purposes. (The specific purposes it can be put to are dependent on its features, but regardless of which features it has, this same architecture would apply, I think.)
It’s not possible to completely isolate it, though. The encoding is going to have inputs that it is able to deal with, and outputs that it is able to generate. Those may change over time, if the rules change. (They won’t always change when the rules change, but they often will.)
Similary, the application may change in terms of the information it’s collecting, or what it wants to do with the results. So there may be a need to modify the middle layer if the data structure of the laws changes or the data structure of the application changes.
But that translation can be isolated, so that you know where it is, and what needs to be fixed when things change.
I anticipate that the task of building the middle layer will fall, most commonly, on the application developer, because it doesn’t require any substantive knowledge of the rules themselves, just substantive knowledge of the intentional meaning of the variables used in the rules’ data structure. But I’m not super confident of that. If it does, there is an obvious risk that it isn’t isolated from the rest of the application. Which is OK, if that ends up being how they want to proceed. But it makes it more difficult to know what parts of the application will need updating when the data structure being used by the law is adjusted.
I’m also currently sort of struggling with the idea that doing it this way, with two additional layers of architecture, and writing far more code for the Rules than you would otherwise need (for the purposes of a single application), means that it will never get done for the purposes of a single product.
The encoding has to be the product, or there need to be so many products that are using the same rules, that change frequently enough or carry some other risk, that a single person saves money by refactoring them all into this architecture. The likelihood of that seems really low. So it feels like maybe it’s not realistic to expect people to volunteer for that, and it falls on the people who are writing the laws to do it that way because it benefits others. Which is not a great adoption strategy.
I know a banking industry organization in the UK tried some rules as code work on behalf of their members, but I don’t know how far it got.
Anyway, random thoughts for a Friday.