Y
Y
Yaroslav2013-12-19 14:38:51
Validation
Yaroslav, 2013-12-19 14:38:51

Checking / classifying structures for compliance with user rules / templates - is there a universal method?

I wanted to quickly build a bicycle, but I thought - the task seems to be extremely frequent - surely there is a general universal solution? (logic says - everything should exist, the experience of administration says - everywhere their home-made "bicycles").
There are many places where you need to check that the data structure matches (or does not) the user's template:
- the firewall allows you to check data from the packet and from the session status ("if protocol==tcp and dst_post==80, then ...")
- some web server module: ("if request=="/admin/.* and remote_ip != 1.2.3.4" )
- the application itself ("if the test comment contains the word "guppy" (then set the label "aquarium"")
- email client ("if From=="[email protected]* and (subject contains "error" or body contains "error")" - put in folder "error messages from servers")
All this can be thought of as a structure to be checked (package , query, comment, email message) and a custom rule set (quite powerful, with support for boolean logic, etc, but still a simple, non-pluggable programming language like LUA (that would be overkill), easily serializable)
. Is there a ready-made mechanism that does this?So that any software where you need to classify any arbitrarily complex structures could simply connect the required lib, and you could immediately write arbitrarily complex classification rules in some more or less standardized format?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2015-07-07
@2ord

I don’t know about universal methods for any subject area. However, for complex logic, decision tables
should be used . In theory, these tables can be stored in a database, brought together taking into account the subject area.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question