Business rules are logical constructs that express how a business uses its data. You can use a set of built-in referential integrity (RI) options to capture common business rules that apply to relationships between data that you maintain in different tables. You can enforce the rules using a variety of different programming techniques, including the following:
One of the best ways to enforce RI rules is through the use of triggers. Unlike the coding in front-end applications, triggers are centrally located, so that if the business rule changes, the change can be implemented once. Triggers also support the enforcement of additional rules, beyond those supported by declarative referential integrity. For example, in an Order Entry database, if you want to flag backorder items when creating a row in the CUST_ORDER table, you can create a custom trigger to check a quantity_on_hand value for a product when inserting a row into the ORDER_LINE table.
erwin® Data Modeler triggers can handle the most common rules for enforcing referential integrity without any additional programming or customization. For example, the question, "Can I delete an order that has one or more order line details?" can be answered by a business rule and can be enforced by a built-in trigger. If the business answer to the question is:
In a similar way, the business rule might specify that the dependent rows in the child ORDER_LINE table should not be deleted when the row in the CUST_ORDER table is deleted, but that the foreign key value should be set to NULL or to a default value. You can handle each of these situations using erwin® Data Modeler-generated triggers.
Copyright © 2017 erwin Inc.
All rights reserved.
|
|