(Slightly)OT : Any patterns/idioms for implementing a decision table in OO language such as Java



Anyone aware of patterns/idioms for implementing a decision table in OO

language such as Java? I googled it and came up with little. There
are engines out there but I only need to implement a small table so I'd
rather just code it by hand. I basically would like a simple descision
table to used by a controller (Struts Action) determine what the target
view is (what JSP) without hard coding nested if/else with various
nested block returning the same (duplicate) outcomes as other nested
blocks. I though a decision table would be clearer and make it
configurable (property file) rather than hard coded. My table might
look like this (I hope the formating comes out right):

scenarios lookup_worked lookup_failed worked_but_restricted
role(s)
creator edit_view form restricted_msg_view
restricted_viewer normal_view form restricted_msg_view
viewerAll normal_view form normal_view
consumer normal_view form normal_view

etc.

Alternatives? Some sort of multiple dispatch using Visitor? (Could be
worse then nested if/else with duplication!)

.



Relevant Pages

  • Failed to create functional JAR
    ... Java HotSpotClient VM. ... WARNING: Duplicate name in Manifest: Manifest-Version ... the hourglass, and at the taskmanager, on the process tab, i saw ...
    (comp.lang.java.programmer)
  • Re: CLOS and databases
    ... > What will be the Java generated code in this case? ... In bytecode you use dup (duplicate the last item on the operand stack), ...
    (comp.lang.lisp)
  • Re: Anyone playing with Groovy or Grails?
    ... For example, if there exists a standardized logging method in Java, you'd ... have to duplicate it to Python or Ruby. ...
    (comp.databases.informix)
  • Re: Duplicate Keys in a Map !
    ... sure a HashMap where the value is an array or ArrayList of the ... duplicate values. ... HashMap just hands you back the list of duplicates. ... http://mindprod.com Java custom programming, consulting and coaching. ...
    (comp.lang.java.programmer)