Design to accommodate change: Table-driven programming [pdf]
martinfowler.com
martinfowler.com
Contrast this with Jonathan Edwards's presentation on schematic tables (a powerful generalization of state charts) which despite its somewhat academic feel makes a strong case to the reader by employing a significant non-trivial example--an example which is admittedly also elegantly solvable in a lazily evaluated language like Haskell, as I pointed out to Jonathan a while ago: http://alarmingdevelopment.org/?p=366
I take the view that if it walks like code and talks like code, it must be subject to the same rules as code. It must be checked into version control where it can be diffed and reverted. It must be pushed through staging and production. It must be testable, preferably with some kind of declarative tests.
In one system, we built the DSL for rules AND a DSL for declaring test cases so the analysts could write new rules and write tests for them.
You may have the same approach, or not as you deem appropriate.
In reality (and I think this is your point) the consequence is that just because a system can support a particular combination doesn't mean it makes any sense for the problem domain. Therefore by exposing this to users without tests, they can screw themselves over, even if the system continues to "work."
Boy have I been bitten by that one before. I've learned after some time that punting the logic into customer-controllable data doesn't absolve it of all the problems that traditional code has.
In one system, we built the DSL for rules AND a DSL for declaring test cases so the analysts could write new rules and write tests for them.
Can you elaborate on how your DSL looks? How does one structure it to be powerful enough to encapsulate logic and simple enough for analysts to use?
Is it just simplified mathematical expressions? Or something more elaborate?
In some ways the problem is much worse than for plain old code written by plain old programmers. Once a problem has been analyzed and the structure of its solution has crystalized, table-driven code can often be the right way to factor out the messy ad-hoc business requirements--there's a cool war story about that in Programming Pearls. But just throwing tables at everything for the business analysts to sort out is almost certain to lead to a combinatorially explosive mess of case analyses that's wholly unmaintainable. As you'd know if you've dealt with end-user programming, whether in the form of tables or visual scripting, non-programmer power users are perfectly willing to crank out reams upon reams of case analysis code when left to their own devices.
http://books.google.com/books?id=1AlWbXItiCYC&lpg=PA52...
The entire text can be found here as a free PDF: http://thinking-forth.sourceforge.net/
[1] http://seleniumhq.org/docs/02_selenium_ide.html#test-suites
http://en.wikipedia.org/wiki/Subtext_%28programming_language...
But still, a lot of interesting thinking went into something like this, and it makes you wonder if it would be appropriate to "embed" a similar interface into an IDE for manipulating complex switch case/elseif chains.
http://weblog.raganwald.com/2008/02/mouse-trap.html
tldr: Excel >> VBA >> XML >> XSLT >> Java!