Download ODÉON: An Object-Oriented Data Model Jacques Supcik
Transcript
Classification Constraints
6.2
Until now,
49
only considered the role of transactions for guaranteeing
logical integrity of a database system, but transactions do not have to
restrict them-self to this role. Actually, they can also be used to guarantee
the physical integrity of a database system. This role is not part of the log¬
ical model, but we will come back to this issue in the second part of this
we
the
dissertation.
6.2
In
a
Classification Constraints
model, the logical consistency of
our
a
database system is defined
A constraint is
set of rules called constraints.
an
by
invariant that must be
checked and validated at the end of each transaction, in order to allow its
commitment. We do not have to check the constraints at the
a
transaction, because
as we
have
seen
in the
beginning of
we already
beginning of a new
previous section,
know that the constraints have to be valid before the
transaction.
In
our
model, the consistency constraints
specified by
are
an
equation
only if
between two
A constraint is said to be valid
both sides
otherwise
algebraic expressions.
of the equation are equal,
we
violated. The formal definition of the constraint
say that the constraint is
equations
is
given by
the
following syntax:
constraint
expr
term
=
=
factor
For
we
expr
=
=
{
"
"=
expr.
term},
factor { "n "factor},
term
"U
"
"("expr ")
example,
write the
\
"
collection
| 0.
to impose that the collectionMe«
following constraint:
Men n Women
Some
but
=
and Women must be
disjoint,
0
models, like OM, have
we
will show that
constraints that OM
a higher language for defining the constraints,
simple model is powerful enough to express all the
define, and even more if we want. The rest of this
our
can
section describes all the constraints from the OM model and their
within
our
model.
equivalent