by username90 on 7/30/21, 3:45 PM with 11 comments
The way it would be used is that programmers writes some interface in their language, and then that interface becomes a compiler that can verify and compile a business logic script file. The script would run in a sandboxed environment with resource restrictions so it can't run too long or crash the server.
Such a language wouldn't just help people write code files for apps, but could also enable just having a textbox field where you could add programs to filter or sort results to your liking etc. I guess you could view it in the same way as the popular regular expression language that is embedded in so many apps and programs, but with enough power that it would cover most business logic needs.
Since it was designed from the start to be sandboxed like this it wont be hard to make it safe, and as it gets wider appeal more people would get interested in programming. That is the theory at least, is anyone aware of attempts to do this? The requirement that it can't depend on external code is absolutely necessary though, that is the main advantage of regular expressions and why you can easily embed those in API's.
by open-source-ux on 7/31/21, 3:10 PM
To make this work well, you must put serious effort into creating a database schema (design) that meets the criteria for normalisation - up to third normal form. Do this even if you later decide to de-normalise.
Some developers are against the idea of placing business logic in a database. But I'd argue that business logic in your database minimises the code in the supporting programming codebase.
Of course, business logic can't always be clearly separated by database and code, but favour the database over the programming code for business logic when possible.
by kognate on 7/30/21, 4:12 PM
and Drools: https://www.drools.org
There are papers describing using OWL for biz rules, too: https://link.springer.com/chapter/10.1007%2F978-3-642-32689-....
One of the biggest problems (IMHO) in this space (which I've worked in CLIPS-based systems http://clipsrules.sourceforge.net) is that business rules are often not as "logical" as they seem and can cause real problems for novices without formal logic training. Sometimes the business rules aren't even "rules" as such, which makes it really hard to both create and explain.
by _benj on 7/31/21, 1:04 AM
What I have found with this approach is that sometimes it can be difficult to draw a clear line between business logic code and infrastructure code.
Traversing through a list of customers to make a report… do you call a dedicated function or do it on the scripting language? If you need a slightly different report format (including address + phone number) do you write a new function on the host lang or implement it as business logic?
by aranchelk on 7/30/21, 9:40 PM
I believe it used to be called ILOG. I’ve never used it.
by throwawaybutwhy on 7/31/21, 3:24 PM
Now, on a more serious note. Codebases are too big and complex precisely because business rules are a mess. Disabling composition, modularity won't help you in the slightest.
by aszen on 7/30/21, 7:14 PM
by mimixco on 7/30/21, 3:52 PM
by philipswood on 7/30/21, 5:25 PM
Also you're describing the architectural drivers that give rise to plugin systems or device drivers in OSes.
As a counterpoint check out the inner-platform anti-pattern.
by ralston3 on 7/31/21, 1:13 AM
by dexwiz on 7/30/21, 4:00 PM
by flamesofphx on 7/31/21, 8:33 AM