Monks,
I need some suggestion/advice on creating a config/rules files for an application that Iam developing. The key requirements being
- The constructs should be easy to understand and user friendly
- The language should be powerful to be able to express all the requirements.
We basically want to process a object hierarchy. The processing rules will be taken as input in the form of a config file. The rules can be either inluce rules/exclude rules. The rules can apply to single object or a class of objects and any rules applied to the top level should descend down the levels of the tree.
I will illustrate that with an example. Let us assume Iam creating a visa processing application. We can organize the data in hierarchy like
Hope this gives an idea. The person can be a Male or Female. The visa processing rules can be like,
- All people from CountryA, CountryB, CountryC, CountryD should be given a visa
- All females from CountryZ will get visa
- People from CountryB and whose state is not 'xx' should be given visa.
- People whose name start with 'J' should not be granted a visa.
NOTE Even though rule #1 says all people from CountryB can get a visa, the rule #3 overrides it with saying only people whose state is not 'xx' can get a visa
Is there a generic module or design concept available that I can reuse. I was thinking of something like a sequence of SQL select like statements that will express this. But Iam not sure how it can take care of the overrides by the rules that follow. If this can be achieved by a perl data file with multilevel hash, I have no issues. I guess a known syntax(Perl/SQL...) will avoid the overhead of learning a new representation scheme.
Any pointers to similar work or suggestions are welcome.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.