Constraint maintenance using generated methods in the P/FDM object-oriented database (original) (raw)
1994, Rules in Database Systems., …
We discuss the use of code-generated methods in Prolog as a exible and e cient way to implement complex semantic constraints in an OODB. We introduce a high-level constraint language CoLan, based on functions and sets and including range quanti ers, from which fragments of code are generated to check the constraints. These fragments are attached to slots in class descriptors, and are also inherited (constraints cannot be overridden). Thus many fragments can come from one constraint and one slot may have attached fragments from many constraints. Constraints can be selectively disabled or removed which causes inhibition or disabling of corresponding fragments. This overcomes many objections to implementing constraints through methods. We have prototyped it by using the metaclass facilities of ADAM to initiate code generation. We are now re-implementing it in P/FDM, using changes to metadata (P/FDM does not have full metaclasses). This will incorporate a transaction mechanism and also provide queries on constraints. This approach opens a number of interesting future directions.