|
Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 | Fly University Consider using DBMS facilities to simulate a simple data-change-oriented rules service. Indeed, many readers have been delivering a data-change-oriented rules capability for years by coding rules using DBMS facilities. In the simplest form, then, you can implement each rule in the DBMS using table definitions, view definitions, triggers, and so on. In this way, when your application attempts to update the database, these rules execute automatically and disallow database updates that violate the rules. Guideline 12.7.2 Consider coding a rules capability that translates database updates into rule executions. In many cases, the use of DBMS facilities may be unacceptable because it represents a two-tiered approach or is limited to only one DBMS. If so, you may consider building a simple rules capability that is called by an application when it wants to access data. Either the application itself or the rules capability needs to correlate the application request with its specific database accesses. Then, the rules capability associates those database accesses with the rules that protect those parts of the database, and execute those rules. Guideline 12.7.3 Consider including rules within methods of data-change-oriented object classes. Another option is to create an object class for each target table or file where that object class contains a method for inserting, updating, and deleting rows or record instances. These methods would execute all rules that protect the target data. This option does not explicitly separate the rules execution from the rest of the application. As you can see, as the number and complexity of underlying data structures and rules increases, your system would benefit greatly from an appropriate rules product. A commercial rules product may also automatically manage the generation and distribution of rule code. Step 12.8: Design for Rules in a Commercially Available Service-Oriented Rules Product If a data-change-oriented rules service is data-centric, it seems only natural that a service-oriented rules service is process-centric. Specifically, when using a service- oriented rules product, the rule design effort tends to be process oriented. It usually involves creating an object model with which to communicate or share data with the rules service. Usually, the objects for rule execution contain data only, no rules. After all, the rules are in the rules service. You express the rules sometimes in procedural code and sometimes not. If declarative, you may be able to use If/Then syntax. You are not likely to need to change database specifications since a service-oriented rules capability is not so closely tied to the data. The rule design effort usually involves grouping rules into executable sets or hierarchies, sequencing the execution of rule sets, and possibly sequencing the execution of rules within rule sets. You do this so that, when your application calls the rules capability for rules execution, the rules capability has been set up to perform that service in a particular manner. Below are generic steps that are common across most service-oriented rules capabilities. Again, this chapter discusses the steps while Chapter 14 provides product- specific details. Step 12.8.1: Create a Component Model of Application Showing Rule Service Component A component model provides a graphical understanding of how the rules capability fits into your application architecture. The component model diagram illustrates the application component, the rules service component, and the database component. Remember, your system invokes the rules service, so it is useful to see how this fits together. You may even have various kinds of rule services. stock option trading | forex trader | making moneypick stock | investment banking | global forex trading split stock | stock photography | nintendo wii in stock stock quote | forex trading strategies | earn money stock investment | money | forex strategy stock trade | forex exchange | option trading Step 12.8.2: Develop an Object Model for the Rules Capability This object model refers to the objects about which you want the rules product to execute rules. As such, it is usually a subset of the full application business model and usually contains attributes only, no methods and no rules. This object model is a vehicle for communicating data to the rules service. |