N
neuneudr
Hi,
In a java client-side program, I need to allow the end-user to define
"rules". Similar to scoring rules (no unlike what some newsreader
have to rate posts).
For example the user can choose some "stat" (say 'A'), then some
operator (say '>='), then define a value (say '30') and then some
action happen (say give +1 to the score). And if A >= 30 then it
'scores' one point, etc.
The 'action' may be, for example, modify some scoring, coloring a row,
triggering a sms-alert, applying another rule, etc.
I don't even know what's the name of such a 'thing' (which hinders my
Google-Fu).
Note that I don't necessarily need a parser for I shall use the GUI to
confine the 'stat', 'operator', 'value' and 'action' parts in their
respective textfield/combobox, etc.
I have some idea as to how to this but I don't want or reinvent the
wheel and I don't want to violate Greenspun's Tenth rule of
programming:
" Any sufficiently complicated C or Fortran program contains
" an ad hoc, informally-specified, bug-ridden, slow
" implementation of half of Common Lisp.
I'm looking for help as to how I should design this. Maybe there's
some clean open-source *OO* project that does something similar?
The requirements are going to evolve over time (new actions, new
operators, etc.).
Any hints / help / pointers is most welcome,
In a java client-side program, I need to allow the end-user to define
"rules". Similar to scoring rules (no unlike what some newsreader
have to rate posts).
For example the user can choose some "stat" (say 'A'), then some
operator (say '>='), then define a value (say '30') and then some
action happen (say give +1 to the score). And if A >= 30 then it
'scores' one point, etc.
The 'action' may be, for example, modify some scoring, coloring a row,
triggering a sms-alert, applying another rule, etc.
I don't even know what's the name of such a 'thing' (which hinders my
Google-Fu).
Note that I don't necessarily need a parser for I shall use the GUI to
confine the 'stat', 'operator', 'value' and 'action' parts in their
respective textfield/combobox, etc.
I have some idea as to how to this but I don't want or reinvent the
wheel and I don't want to violate Greenspun's Tenth rule of
programming:
" Any sufficiently complicated C or Fortran program contains
" an ad hoc, informally-specified, bug-ridden, slow
" implementation of half of Common Lisp.
I'm looking for help as to how I should design this. Maybe there's
some clean open-source *OO* project that does something similar?
The requirements are going to evolve over time (new actions, new
operators, etc.).
Any hints / help / pointers is most welcome,