Databases Reference
In-Depth Information
1.
A condition on the DB state (e.g., the number of students is above
20 );
2.
The invocation of a structural operation (e.g., the assignment of a
room to a course can be realized as an insertion on the distribution
table);
3.
The invocation of a domain operation (e.g., a course is cancelled );
4.
A complex history of previous operations within an interval (e.g.,
fewer than 20 enrollments within a month of a course being
approved ). It is worth noticing that the cause is not that 20 stu-
dents are currently registered, but that the operation enrollment
has been invoked 20 times in a given time frame, that is, it is not a
condition on the DB state but on the history of the event flow.
The first two cases can be supported with active rules using a similar
approach to the one presented in the preceding section. However, policies
caused by domain operations need some further explanation.
Although data are the traditional asset of DBMSs, currently most of the
systems also support the description of domain operations within the realm
of the system through stored procedures. As an example, consider a course
cancellation, which affects distinct tables: tuple deletion in the distribution
table, tuple deletion on the enrollment table, tuple modification on the
course table, and so on. All those low-level structural operations can be
grouped into a domain-meaningful operation through a cancellation stored
procedure. The benefits include modularity, maintainability, and reduction
in network traffic as the whole set of structural operations is executed locally
after a single invocation of the procedure.
Lets go back to the cancellation policy, which states that before cancel-
ling a course, if there are already some attendees enrolled, they should be
moved to a related course (e.g., the same course but taught at a different
time). The question is whether the policy should be supported as an inde-
pendent active rule or within a stored procedure. The former approach
implies the definition of rules such as
before cancellation(C: course)
if (select count(E.theAttendee)
from enrollment E
where E.theCourse = C) > 0
do .....
Search WWH ::




Custom Search