(Slightly)OT : Any patterns/idioms for implementing a decision table in OO language such as Java
- From: "chuck" <cmedcoff@xxxxxxxxx>
- Date: 27 Sep 2005 14:36:49 -0700
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!)
.
- Prev by Date: Re: data and interfaces
- Next by Date: Re: Factory pattern and building object
- Previous by thread: Strategy or A factory with Template Method
- Next by thread: Really Stupid Question
- Index(es):
Relevant Pages
|