Databases Reference
In-Depth Information
This is something that you would probably handle through the applica-
tion. When the customer tries to pay by credit card, the application must first
get an approval. This is usually done passing the credit card number and
amount to a credit card authorization service and then waiting for approval.
The approval is often accompanied by some kind of verification code for track-
ing and audit history, just in case there is any kind of question in the future.
What if there's a problem, such as the phone lines being down, or the com-
pany providing authorization being unavailable for some reason. You might have
an additional business rule, such as:
If credit card purchases cannot be automatically approved, then manager
override is required.
FOR EXAMPLE
Using Business Rules
Business rules will relate directly to the business for which you are design-
ing the database. The types of business rules you encounter for a retail sales
company will probably be quite different than the rules for a credit card
company. In either case, the rules will be a design factor.
Consider a situation where you're designing a database for a company
that sells home improvement products. You might have a small number of
customers, such as contractors, who are allowed to charge their purchases
and pay later. When someone tries to charge an order, the person making
the sale must determine the following:
• Does the customer have an established account?
• Does the customer have credit available?
• Can the customer charge these types of items?
• Does the customer get the same discount on the order when charging?
Each of these would result in business rules. You would have a rule that
you can make charge sales only if the customer has an account and is not
over the credit balance. Any other attempts to charge an order would be
blocked. Also, you must have a way to keep track of the customer's current
balance and credit limit. If the customer can charge only certain items, there
would have to be some way of identifying these items in the database and
associating them with customers as appropriate. If the customer normally gets
a discount, but the amount changes when the order is charged, the change
would need to apply automatically. Discount amounts would have to be
stored somewhere in the database and associated with the customer.
Search WWH ::




Custom Search