http://qs321.pair.com?node_id=184085


in reply to Writing a Billing System

Experimentally, take a look at the Rules Wizard in MS Outlook for an example of a UI for rule creation without equations or much other thinking required by the rule-creator. :) Not that I think their rules wizard is extra brilliant or flexible enough, but it is an effective approach, and a good idea-sparker when thinking about rules-based systems. Possibly another rule-builder that may show greater dynamic flexibility would be MS Access' query builder. (Egads, lots of MS examples here.)

If you can be sure that only approved persons, with reasonably viable computer skills, will be creating rules (or macros, or other rule equations), now and in the future, then a hand-entered equation system can be considered. Frankly, I think it's risky to assume the skillset of future rule creators. It's probably a valid argument that the % of the user population of MS Word or Excel that actually creates and uses macros or even slightly complex equations is amazingly small, for a reason.

You may consider having a new rule stored with a unique ID or rulename, have a second person approve the rule before enacting it, database these approvals, have a rule for every pricing issue including regular retail, have a way for the creator to test the equation and approve the results, and, never allow the rule to be deleted or otherwise exorsized. Never alter an older in-use rule -create a new rule instead. The audit trail of what rule was active for any account at any time, etc., will someday be a critical function.

Also, if the rule creates code that gets run (eval'd, etc.) each time the account is looked at (not recommended, store the altered numbers, reference the rule that created the numbers), the deletion of it will forever effect the numbers so it must always be stored.

Designing systems like this can spin wildly out of control when you consider all the variables you'd like to see implemented, or those that you think your users will ask for in the near future. Think simple, but reasonably flexible.

Just some thoughts...