× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



We have some programs that have hard-coding, in the logic phase of a
program. I am thinking it may be interesting to put these together into
a database thereby use this in the code instead. Usually these are
assorted 'exceptions to the rule' accounts.

Anyone who has done please share your experience, ideas on this.

The more generic you make this 'business rule' table, the more sophisticated your documentation and maintenance must become. Examples may be useful.

Let's say you're doing credit checking, and some of your biggest customers would fail that. Your code has a bunch of

if cust = 123 or
   cust = 345 or...

So you decide to move those exceptions out to a table. Now your code looks like

cust chain creditexcept
if not %found
  ... do normal credit check
endif

Your documentation says that to make a customer exempt, add his number to the creditexceptions file. For maintenance, you may only need DFU.


Now think of the situation if you have many hundreds of exceptions, all grouped by customer range;

if (cust >= 123 and cust <= 199) or
   (cust >= 223 and cust <= 299) or
   ...

You'd have two columns in your file, a CHAIN and some compares. Your documentation would require noting the lower and upper limits, and if you want to exclude a single customer, you need to specify the same number in both columns. Maintenance could still be DFU, but it now begins to dawn on you that if you delete a customer from your master file, there are orphan rules left in the credit exception file. Need to add that logic to the master maintenance.

It gets more complex when you want to name your rules, have one rule invoke another and so on. You can certainly move the logic out of the code and into the tables, but you'll be creating a fairly complex set of interrelated tables, and pretty soon, DFU won't be good enough to keep the rules base in synch.

There's no right or wrong here, only how much time and effort you'll be expending in order to make the rules base more flexible (and presumably, changeable by the end user.)

I think that in general, vendors tend to be more interested in table driven systems than companies writing software for their own consumption.
  --buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.